https://pantsbuild.org/ logo
r

rhythmic-morning-87313

07/06/2022, 10:07 AM
--changed-since
seems to exist on
lint
and
check
goals but not
fmt
. How about adding this? Shall I open a feature request on GitHub?
1
Now I'm configuring a git pre-push hook that runs
./pants fmt lint check --changed-since=$(git merge-base main HEAD)
, but it seems that...
fmt
does not have this option.
b

bitter-ability-32190

07/06/2022, 10:27 AM
That flag is not implemented on any goal, and is it's own subsystem. That way it works with every goal which expects specs. What makes it seem that fmt isn't being run?
w

wide-midnight-78598

07/06/2022, 12:35 PM
If you want to see which files are passed to those goals, you should be able to run something like:
./pants --changed-since=origin/main list
r

rhythmic-morning-87313

07/06/2022, 1:28 PM
ah... that's my mistake
--changed-since main
-> not working
--changed-since=main
-> working (even with
fmt
)
👀 1
without the equal sign, it says:
image.png
b

bitter-ability-32190

07/06/2022, 1:30 PM
Can you file a ticket? At the very least we could provide a hint ("did you forget an equal sign?")
c

curved-television-6568

07/06/2022, 2:25 PM
yeah, pants requires all option values to be provided on the cli using the
--option=value
syntax.
r

rhythmic-morning-87313

07/06/2022, 2:27 PM
i think if this is the intended design, it's fine but just adding a note to the documentation would be good
👍 2
c

curved-television-6568

07/06/2022, 2:27 PM
I think it is slightly unfortunate that we’ve a bespoke cli library, rather than using something like `click`… (I do see the history here, and the pain it would be to adapt to someone else’s idea of how things ought to work…)
1
b

bitter-ability-32190

07/06/2022, 2:33 PM
Click is reasonably pluggable. So there might be hope in offshoring the work, although more 3rdparty means slower installs and more room for attack.
h

hundreds-father-404

07/06/2022, 2:46 PM
Yeah I wasn't there, but from what I understand, argparse wasn't powerful enough when the options system took place. We weren't using Rust either
fyi @rhythmic-morning-87313, a sneak peek of Pants 2.13 is that we made major improvements to command line arguments so that it's now consistent across every goal. There were weird things like that you run
./pants tailor
, not `./pants tailor ::`; and
./pants --changed-since=HEAD tailor
didn't work It's all consistent now 🙂 blog post coming later this month
🙌 2
b

bitter-ability-32190

07/06/2022, 4:33 PM
w

witty-crayon-22786

07/06/2022, 4:40 PM
if options parsing goes anywhere, it should go to rust, since John implemented 90% of the port already. that unblocks very, very low latency startup, without starting the python interpreter at all
💯 2
👀 3
4 Views