does `pants lint ::` run in parallel?
# general
p
does
pants lint ::
run in parallel?
It ends up being slower than pylint is why I'm asking.
b
Yes. It runs batches of files in parallel (if not cached). Likely pylint is using some cache that Pants can't use (for correctness)
p
Can we change the batch size? Basically if I have a batch of 100 and one file in the 100 changes.. does that invalidate that batch? Odd question.. I don't think that is the case, but that is what a engineer believes.
b
Yup it does. Batching is the middle-ground solution between "run one pylint process per file, likely saturating the CPU for a long time" and "run pylint with all files in it" essentially making the cache pointless 🙂
p
It seems that the problem is that the engineer is using the pre-commit workflow where in the past pre-commit would pass the list of files that changed. --changed-since=(branch) seems to not be as fast.
b
Using
--changed-since
nets you in the latter category, unfortunately. The list of inputs changes, and therefore the cache isn't very helpful
There's a floating idea I'll probably tackle in the coming months of opting into a different cache of "synthetic" results per-file. So you run on one big batch but pretend you did it per-file.
p
Interesting.
Perhaps it would be quickest to somehow make
pants run pylint
work for pre-commit?
Granted
.build/requirements:pylint#pylint
leads to missing plugins. Is there a way I can run pylint how pants does?
pants export perhaps
b
Outside of
--keep-sandboxes=always
I'm not sure there's an easy way