https://pantsbuild.org/ logo
w

wonderful-iron-54019

06/25/2020, 4:06 PM
[Linting Differences between Pylint vs pants thread]
Trying to move from pylint run against the entire repo into ./pants with v2
getting significantly different results b/w the two even with versioning andd config set. up
including a
too many similar lines
error between different targets. which based on my understanding of pants execution model should be impossible
w

witty-crayon-22786

06/25/2020, 4:18 PM
Regarding the execution model: by default lint does not run per target because of the overheads of per-target runs. But you can toggle to that mode, and you'll get much better caching behavior and actual isolation
On my phone, will post a link shortly
w

wonderful-iron-54019

06/25/2020, 4:23 PM
cool that makes sense
although still not sure how running it with vanilla pylint across the entire repo doesn't turn up that error
makes me think my config either isn't loading properly or something else is going on
w

wonderful-iron-54019

06/25/2020, 4:24 PM
yup!
Copy code
[pylint]
version = "pylint==2.3.1"
config = ".pylintrc"
source_plugins = ["build-support/pylint:custom-linters"]
đź‘Ť 1
i know its at least loading it partially since it complained about the source_plugins until i added them to my
toml
đź‘Ť 1
w

witty-crayon-22786

06/25/2020, 4:36 PM
Copy code
--[no-]lint-per-target-caching
  default: False
  Rather than running all targets in a single batch, run each target as a separate
  process. Why do this? You'll get many more cache hits. Why not do this? Linters
  both have substantial startup overhead and are cheap to add one additional file
  to the run. On a cold cache, it is much faster to use `--no-per-target-caching`.
  We only recommend using `--per-target-caching` if you are using a remote cache
  or if you have benchmarked that this option will be faster than `--no-per-
  target-caching` for your use case.
w

wonderful-iron-54019

06/25/2020, 4:38 PM
i'll play with this thanks
w

witty-crayon-22786

06/25/2020, 4:38 PM
i don’t think we knew that pylint had any sort of “aggregate across all files in a target” behavior. good to know.
but yea, for a larger repo, you’ll almost certainly want to enable that.
h

hundreds-father-404

06/30/2020, 9:09 PM
i don’t think we knew that pylint had any sort of “aggregate across all files in a target” behavior.
Yeah, Pylint gives you a final score at the end of the run