bitter-ability-32190
07/16/2022, 6:09 PMfmt fixes style, what fixes semantic issues?"
Pile in thread: 🧵bitter-ability-32190
07/16/2022, 6:14 PMfix ) or try and create a new one (a la tailor). There's pros and cons to either.
I doubt we'll find an existing schema we can all agree on, so I suggest we consider a punny new one. Although too many of these and users get lost "what does stitch do again?"
My current guesstimate is something to the tune of mend. 🤷♂️hundreds-father-404
07/16/2022, 6:20 PMmend vs fix is solid
Sorry if this derails, but I continue to not love lint vs check. The split for sure makes sense, only I think it might be a little confusing how do you run `fix`/`mend` in check-only modecurved-television-6568
07/16/2022, 6:24 PMstretch. Check only lint
Fix - retrofit. Check only lint? (No need to have a separate goal for check only operation, maybe..?)
Just playing with alternatives. mend as well as fix are both good options in my book.bitter-ability-32190
07/16/2022, 6:26 PMstyle for fmt , but let's not get derailed 😉bitter-ability-32190
07/16/2022, 6:27 PMwide-midnight-78598
07/16/2022, 6:44 PMlint either, but 🤷" - that's super common nowadays (for better or worse). As is format/fmt, build, compile, typecheck, test, package, init, deploy, publish, export, version, inspect, etc...
Those verbs are not super ambiguous language to language or tool to tool, and any reasonable developer could approximately infer (within reason) what they should do.
Tools (in-house or public) that make me sound like I'm quoting Harry Potter definitely make my blood boil.
I think one of the worst examples was a backend pipeline that was something like "did you remember to deflux the capacitor before deployment" - thinking they were being clever.hundreds-father-404
07/16/2022, 6:47 PMdependencies and test
So I'm generally much more pro fix than mend. Even though it's imperfect, just like check is very imperfecthundreds-father-404
07/16/2022, 6:47 PMwide-midnight-78598
07/16/2022, 6:50 PMwide-midnight-78598
07/16/2022, 6:51 PMwide-midnight-78598
07/16/2022, 6:52 PMdeploy goal, and what the constraints there are, so coming up with loose rules here seems reasonable - with all the effort that has gone into this so farhundreds-father-404
07/16/2022, 6:52 PM./pants help goals
check Run type checking or the lightest variant of compilation available for a language.
fmt Autoformat source code.
lint Run all linters and/or formatters in check mode.
tailor Auto-generate BUILD file targets for new source files.
update-build-files Format and fix safe deprecations in BUILD files.bitter-ability-32190
07/16/2022, 7:01 PMhappy-kitchen-89482
07/17/2022, 1:18 AMfmt? I know it's a slight abuse of naming, but in practice maybe it's fine?happy-kitchen-89482
07/17/2022, 1:19 AMbitter-ability-32190
07/17/2022, 1:21 AM--loop or running fmt on save.
The fact that we haven't already probably says something as well?bitter-ability-32190
07/17/2022, 1:22 AMbitter-ability-32190
07/17/2022, 1:27 AMhappy-kitchen-89482
07/17/2022, 1:48 AMhappy-kitchen-89482
07/17/2022, 1:52 AMhappy-kitchen-89482
07/17/2022, 1:53 AMfix is a good name for semantic fixes (and apparently there is prior art in go and rust and maybe scala in calling it that).happy-kitchen-89482
07/17/2022, 1:54 AMfmt in perpetuity? Not sure I was convinced that we need to deprecate it.happy-kitchen-89482
07/17/2022, 1:54 AMfmt is changes you don't need to eyeball, fix is for changes you probably shouldbitter-ability-32190
07/17/2022, 10:32 AMfmt plus add XYZflat-zoo-31952
07/17/2022, 1:36 PMcheck that are too general as well and it seems people don't love those) and prior art disagrees a bit on what's included. (Rust vs Go)flat-zoo-31952
07/17/2022, 1:49 PMgo fix style "update API" actions, it would be confusing to have a verb mismatch there, e.g. "to run go fix you need to run ./pants fix --update-api or `./pants update-sources`" or whatever the naming would be for that.
Basically if we want to use fix I think we need to be sure that it can sensibly incorporate all ideas of the native tooling that uses that that we're targeting. Right now I think Scala and Go are the only supported languages that have this command. So ./pants fix should do at least what go fix does on Go targets and at least what Scala fix does on Scala targets.flat-zoo-31952
07/17/2022, 1:51 PMfix? I don't have a great answer to that question, and it's kinda academic anyways since that doesn't really exist. But it highlights my concern about prior art having different ideas of what this word should meanbitter-ability-32190
07/17/2022, 1:53 PMgo fix in this goal?hundreds-father-404
07/17/2022, 1:54 PMgo fix to be included in ./pants fix. You can use ./pants --go-fix-skip or ./pants fix --only=pyupgrade if you want to ignore ithundreds-father-404
07/17/2022, 1:54 PMfmt and fix staying separate. I originally was proposing merging themflat-zoo-31952
07/17/2022, 2:58 PMgo fix fits in their workflow, and if that jives with what we've discussed around this topicwide-midnight-78598
07/17/2022, 5:02 PMcargo fix as well.
I think it is a reasonable assumption that if you're a user of said language, that piping ./pants fix down to that language's native(ish) version of that command is fair game - and you, as the developer, would understand the consequences. It's more about the languages that don't have that concept where I'm a bit more suss.
./pants fix cpplib or ./pants fix pythonlib - not sure what to expect.bitter-ability-32190
07/17/2022, 6:30 PMclang-tidy -fix and tools like pyupgrade respectively?wide-midnight-78598
07/17/2022, 7:37 PMfix option.
In my mind, fix might end up being any auto-correctable lint warning/error (like clang-tidy --fix, eslint --fix, etc). By virtue of adding the pyupgrade add-in, you're essentially stating that anything pyupgrade finds is a lint error, and since we can fix it - we will fix it. So, I view fix and lint as coupled goals (nothing wrong with that). Is there the chance that a fix goal would make changes that wouldn't otherwise show up as lint warnings/errors?bitter-ability-32190
07/17/2022, 7:42 PMlint rule, 100% of things fix would change would cause a lint error 🙂bitter-ability-32190
07/17/2022, 7:43 PMhundreds-father-404
07/17/2022, 9:27 PMcan just run one command for all statically determined issues.Sort of,
check also is necessary; womp womp weirdnesswide-midnight-78598
07/18/2022, 12:09 AMwitty-crayon-22786
07/19/2022, 3:56 AMfix due to the growing convention of rust, go, scala, etc. the line between fmt and fix being “syntactic vs semantic” changes is reasonably easy to explain.
and lint and check remaining separate is important i think, although we need to continue to sharpen the line between them: to the extent that tools using transitive deps are in lint (pylint) they should probably be in check instead… they’re closer to being compilers than the traditional expectations of a linter.