bitter-ability-32190
03/02/2022, 1:08 AMfmt
and lint
use the same process (the args used for formatting) for both fmt
and lint
. fmt
then applies the changes to the workspace while lint
diffs (optionally outputting the diff if requested). Then ./pants fmt lint ::
is a no-op in lint
for formatters ๐
The risk is meaningful stdout/err
being removed from the tool, but the gain is perf through caching, consistency, and plugin simplification.bitter-ability-32190
03/02/2022, 1:08 AMhundreds-father-404
03/02/2022, 1:13 AMโฏ ./pants lint --only=black ::
18:12:04.56 [WARN] Completed: Lint with Black - black failed
reformatted src/python/pants/goal/stats_aggregator.py
All done! :sparkles: :cake: :sparkles:
1 file reformatted.
bitter-ability-32190
03/02/2022, 1:15 AMstdout/err
is meaningless (unless they crash-and-burn).
All you are told is a verbal yes/no. but each tool does so slightly differently.
If anything, I think if Pants took the reigns so-to-speak UX would improve due to consistency.hundreds-father-404
03/02/2022, 1:18 AMIf anything, I think if Pants took the reigns so-to-speak UX would improve due to consistency.Something fascinating about your proposal is that it makes it more feasible for Pants to list the files that changed. Iirc docformatter doesn't tell you what failed, only that something did. Which is annoying if you want to run on just 1 file rather than 2000 the next run. Parsing std{out,err} would not work, but diffing the input vs output digest could. I'm still pretty hesitant to move into the brave new world where Pants is writing std{out,err} for you because it seems like so many unknowns, like if you really really want Black's output because you're debugging something. But this makes me slightly more open to it
bitter-ability-32190
03/02/2022, 1:19 AMexperimental-...
๐hundreds-father-404
03/02/2022, 1:21 AMwitty-crayon-22786
03/02/2022, 1:23 AMhundreds-father-404
03/02/2022, 1:24 AMA major benefit of Pants is that it gives you a consistent and single interface for running all your linters and formatters, regardless of the language:
โฏ ./pants lint ::
โฆ
โ autoflake succeeded.
โ black succeeded.
โ docformatter succeeded.
โ flake8 succeeded.
โ gofmt succeeded.
โ google-java-format succeeded.
โ isort succeeded.
โ shellcheck succeeded.
โ shfmt succeeded.
especially w/ batching of tools, that is a lot of output nowbitter-ability-32190
03/02/2022, 1:25 AMhundreds-father-404
03/02/2022, 1:27 AMSomething fascinating about your proposal is that it makes it more feasible for Pants to list the files that changed.Yeah I like this a lot. I remember @fancy-motherboard-24956 first proposed this consistent interface you're talking about way back in 2019, and a reason we didn't go with it is how it would be a lot of maintenance burden to try to parse the std{out,err} of every single tool, especially because users can change the
--version
. We'd have to teach Pants what each tool's output looks like - no good
This is instead highly generalizable ๐bitter-ability-32190
03/02/2022, 1:21 PMbitter-ability-32190
03/03/2022, 4:13 PMhundreds-father-404
03/03/2022, 4:59 PMbitter-ability-32190
03/03/2022, 5:10 PMhundreds-father-404
03/05/2022, 1:34 AM-ldebug
proposal, but am not sure how to get it to work well.
I recommend pinging more people on Monday to discuss / sign off, then you could proceed with implementation ๐
(Also where did the benchmarks go in the doc?)bitter-ability-32190
03/05/2022, 1:42 AM(Also where did the benchmarks go in the doc?)Scroll down?
hundreds-father-404
03/05/2022, 1:43 AMbitter-ability-32190
03/05/2022, 1:51 AM