https://pantsbuild.org/ logo
a

average-vr-56795

01/06/2020, 5:20 PM
Hey @hundreds-father-404! Funny story! Internally at Twitter we have a goal called
scalafix
which does the equivalent to your
--fmt --fmt-only=scalafix
proposed flag! I know this because when you added the
Scalafix
subsystem, and took the option scope, we started getting errors 😄 How sad would you be if I added a v1
--fmt-only
flag which only accepts not being set, or accepts exactly
scalafix
(i.e. not do the fully general solution) to help us with migration?
h

hundreds-father-404

01/06/2020, 5:22 PM
Totally fine with me! As stated in the google doc, it’s not in my near time roadmap to implement
—fmt-only
. My main goal was to deprecate
—fmt-skip
and that’s now done. (My next project for my free time is the Flake8 plugin so that we can deprecate the checker)
w

witty-crayon-22786

01/06/2020, 5:23 PM
afaik,
--fmt-only
could maybe live on the
v2
fmt Goal, and be consumed by
v1
h

hundreds-father-404

01/06/2020, 5:23 PM
Yes, it can!
But, that won’t work until —fmt-skip is removed :/
w

witty-crayon-22786

01/06/2020, 5:24 PM
true. note to selves, consider accelerating these deprecations.
a

average-vr-56795

01/06/2020, 5:25 PM
afaik,
--fmt-only
could maybe live on the
v2
fmt Goal, and be consumed by
v1
Ooh fancy!
w

witty-crayon-22786

01/06/2020, 5:25 PM
but see above re deprecation =/ ... unless it went on the mixin in the interim, which would work but be strange.
h

hundreds-father-404

01/06/2020, 5:26 PM
true. note to selves, consider accelerating these deprecations.
This problem is why I’m trying to get as many deprecations going now as possible, so that we’re not blocked by similar things in the future I’ll email pants-commiters about our discussion last week to slightly speed up deprecations
a

average-vr-56795

01/06/2020, 5:26 PM
It could go in the mixin exactly until it moves to v2 - would be transparent?
h

hundreds-father-404

01/06/2020, 5:26 PM
Yes, I think that works fine! Fmt2 won’t have the functionality but that’s fine for now
a

average-vr-56795

01/06/2020, 5:27 PM
#CreativeSolutions
w

witty-crayon-22786

01/06/2020, 5:32 PM
there is a minor wart with doing it on the mixin (could do something like
--fmt-scalafix-only=..
) but i would be fine with that briefly appearing and then disappearing at the end of this deprecation cycle
h

hundreds-father-404

01/06/2020, 5:33 PM
Oh yeah the mixin gets applied to both the goal and the tasks...I don’t think the mixin would work?
w

witty-crayon-22786

01/06/2020, 5:34 PM
it would, i think... would just have the wart above.
which imo is fine
a

average-vr-56795

01/06/2020, 5:34 PM
I’ll see what I can hack together 🙂
h

hundreds-father-404

01/06/2020, 5:35 PM
Uh could you do something like an if statement to check if options scope == fmt and if not, don’t register the new option? Horribly hacky but it’s going away soon
a

average-vr-56795

01/06/2020, 5:40 PM
Yeah, I’ll hack something 🙂
w

witty-crayon-22786

01/27/2020, 11:48 PM
sooo, @average-vr-56795: what ended up being the conclusion here? looks like this is an issue in the nightly... is the idea to deprecate/remove the goal and suggest
./pants fmt --only=scalafix
instead?
👍 1
a

average-vr-56795

01/28/2020, 12:03 PM
Ooh, I totally didn’t implement that, did I?
Or did I?
looks through history
Yeah, let’s deprecate the
scalafix
goal internally and suggest that 🙂
I’m pretty sure that internally I did the scope-renaming so that things would work in the mean time
@witty-crayon-22786 Yeah… I guess the thing we need to add is “if someone set
--scalafix-*
and didn’t explicitly set
--temp-scalafix-subsystem-*
override the value of the latter with the former… Ugh…
w

witty-crayon-22786

01/30/2020, 6:52 PM
thanks. it sounds like toolchain are going to lead the
1.25.x
release next week, so i'll need to raise this on the rc threads.
but i think that we have the tools we need to fix it next week.