Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support V2 linters running on Python 2 and Python 3 targets at the sa…
…me time (#9870) ### Problem When using the default `--no-per-target-caching`, `./v2 lint ::` will fail if you have any targets with conflicting Python interpreter constraints, e.g. Python 2-only targets mixed with Python 3-only targets. This is a common problem due to Python 3 migrations. It is not acceptable to say "just use `--per-target-caching`" because we want `./pants lint ::` to work regardless of this setting. ### Solution The main change is for linter rules to now return `LintResults`, rather than a single `LintResult`. Typically, this will only have one element, but it can include more, such as partitioning by interpreter constraints. In JVM land, we might partition by JVM compatibility, for example. Then, Pylint, Bandit, and Flake8 are rewritten to have new rules that take a `Partition` of the original input targets and return a single `LintResult`. Another rule does the partitioning and aggregates these results. ### Result `./v2 lint ::` works on any Python codebase, regardless of interpreter constraints. [ci skip-rust-tests] [ci skip-jvm-tests]
- Loading branch information
1 parent
36f7646
commit 0084854
Showing
16 changed files
with
665 additions
and
366 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
Oops, something went wrong.