bitter-ability-32190
10/11/2022, 8:19 PMfix
, Q on some UX.
Should fix
include formatters by default (and have a --skip-formatters
flag, akin to lint
)?
I think it's a nicer UX as fix
isn't meant to be run in a loop (buyer beware) as it'll blast your code. Running both fixers/formatters means people can still have a one-command "fix everything" goal.
fmt
will remain unchanged.wide-midnight-78598
10/11/2022, 8:21 PMbitter-ability-32190
10/11/2022, 8:24 PMfix
. This is on top of that. Although does make me think, gonna update the Qbitter-ability-32190
10/11/2022, 8:25 PMwide-midnight-78598
10/11/2022, 8:27 PMhundreds-father-404
10/11/2022, 8:32 PMfix
to also run formatters
as toggled by an option. The thing I'm not sure about is the default - I bias towards defaulting to it not running fmt
because it does more work than the user wants, and it's two ways of doing the same thingwide-midnight-78598
10/11/2022, 8:34 PM./pants fix --also-fmt
when you can write ./pants fix fmt
wide-midnight-78598
10/11/2022, 8:35 PMwide-midnight-78598
10/11/2022, 8:35 PMfix
goal?hundreds-father-404
10/11/2022, 8:36 PMI thought the "goal" (no pun) was to merge the two, rather than add a new fix goal?the conclusion was it's better to have them separate
wide-midnight-78598
10/11/2022, 8:37 PMbitter-ability-32190
10/11/2022, 8:44 PMhundreds-father-404
10/11/2022, 8:45 PMbitter-ability-32190
10/11/2022, 8:45 PMhundreds-father-404
10/11/2022, 8:45 PMfmt
when they want to avoid fix
? So, I don't think this is applicable
and it's less goals to remember if you don't care about the differenceYou'd have to teach:
fmt if you don't want fixers, otherwise just use fix!which doesn't seem much better than
if you don't want fixers, otherwisefmt
fmt fix
bitter-ability-32190
10/11/2022, 8:56 PMhundreds-father-404
10/11/2022, 8:57 PMbitter-ability-32190
10/11/2022, 9:05 PMbitter-ability-32190
10/11/2022, 9:05 PMbitter-ability-32190
10/12/2022, 8:13 PMfmt
and fix
code soon đwitty-crayon-22786
10/12/2022, 8:16 PMbitter-ability-32190
10/12/2022, 8:18 PMfmt
and fix
in parallel) there's additional perf for constructing-and-running the batches all in fix
. Instead of batching-and-running in fmt + batching-and-running in fixwitty-crayon-22786
10/12/2022, 8:20 PMwhich wouldnât help this because we cant runwe can: see the discussion on the ticket i linked.andfmt
in parallelfix
bitter-ability-32190
10/12/2022, 8:20 PMwitty-crayon-22786
10/12/2022, 8:20 PMwitty-crayon-22786
10/12/2022, 8:21 PMbitter-ability-32190
10/12/2022, 8:21 PMbitter-ability-32190
10/12/2022, 8:21 PMbut would still be restarted to observe sideeffects caused by other goals.ah
witty-crayon-22786
10/12/2022, 8:21 PMbitter-ability-32190
10/12/2022, 8:21 PMwitty-crayon-22786
10/12/2022, 8:23 PMSo possible, but still liekly worse perf. Got ityea:
but primarily in cases where the previous goal didnât make a changehow much would be reusable would depend on the edits involved
witty-crayon-22786
10/12/2022, 8:24 PMfmt
and fix
are each internally sequential, the actual performance impact here is not as great as it would be for lint
witty-crayon-22786
10/12/2022, 8:26 PMbitter-ability-32190
10/12/2022, 8:27 PMisort
and autoflake
being in different goals makes me think it's relatively likely for a refactor. Not to mention first-one-wins could yield some really annoying have-to-rerun scenarios.
It may be isort
"wins", autoflake
reruns and changes it such that isort
would then fail if rerun đbitter-ability-32190
10/12/2022, 8:27 PMfix
should encompass fmt
and the default of when is up for debatewitty-crayon-22786
10/12/2022, 8:28 PMIt may benot that i necessarily disagree* with you, but this could already be the case, even within a single goal.âwinsâ,isort
reruns and changes it such thatautoflake
would then fail if rerunisort
bitter-ability-32190
10/12/2022, 8:30 PMbackend_backaged
is respected, and if the user crafted those purposefully in a way where "it works" they're now semi-SOLwitty-crayon-22786
10/12/2022, 8:32 PMfix
and fmt
inwitty-crayon-22786
10/12/2022, 8:32 PMfix
always run formatters would rule it out, so.bitter-ability-32190
10/12/2022, 8:33 PMfixer1, formatter1, fixer2, formatter2
Unless it's in one dedicated goal running them seriallybitter-ability-32190
10/12/2022, 8:33 PMbitter-ability-32190
10/12/2022, 9:16 PMbitter-ability-32190
10/13/2022, 1:22 PMbitter-ability-32190
10/13/2022, 4:04 PMfix
?"
⢠Having one goal do both is nicer UX for those who don't care about the difference (I actually suspect it's a majority of Pants users. The difference really only shines for --loop
).
⢠There are tangible increased performance gains, even over the "multiple goals in parallel" feature request
⢠It is thematically correct, as formatters fix style
So then it comes down to the default:
"Default = run both"
⢠The perfect UX for the "I don't care about the difference" crowd. The "I do care" crowd also already is likely fiddling with options anyways (--loop
).
⢠Maintains the thematic correctness without options twiddling
⢠If we make concessions, we can purposefully run fixers first, which means doing this is "always right" (as opposed to reminding people to run fix fmt
instead of fmt fix
)
"Default = only run fix"
⢠I think a subset of people would be surprised this new goal does old goal stuff.
⢠Also slight confusion on whether to enable to option, or run fix fmt
bitter-ability-32190
10/13/2022, 4:04 PMbitter-ability-32190
10/13/2022, 4:05 PMbitter-ability-32190
10/17/2022, 3:00 PM