forked from netromdk/vermin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
No longer require that the number of targets match requirements
In --violations mode, the CLI requires that the number of "--target" specified is the same as the number of requirements. Many users no longer care about Python 2, but may write a simple file which is compatible with Python 2 by chance. In that case, Vermin will return a Python 2.x compatibility entry, and --violations will fail unless a target is specified for Python 2. However, there's no way to specify a target of "I don't care about this version", so these users would be forced to run with something like "-t=2.7- -t=3.6-". Except this would fail on their normal code, which is incompatible with Python 2.x. To get around this, start comparing by the major version of Python. Only compare the versions which are in common between the requirements and target. If there are no versions in common, fail. If a target major version is missing from the requirements, fail. This allows users who only specify a "3.x-" target to know that Vermin will succeed on any code, even simple code which is 2.x compatible too. This fixes netromdk#230. Signed-off-by: Stephen Brennan <stephen@brennan.io>
- Loading branch information
Showing
3 changed files
with
24 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters