I noticed that `buf` and `terraform` have differen...
# development
b
I noticed that
buf
and
terraform
have different strategies for handling not being dedicated to a single goal:
buf
has one subsystem:
buf
which has
format/lint_skip
and
format/lint_args
(sic on
format
)
terraform
has
terraform-fmt
terraform-validate
, etc... It seems to me what we don't have is a guide on how to shape subsystems, what conventions we have, etc... One piece of this would be to introduce "pluggable" options for goals (like injected field for a target). So
black-skip
would be
fmt-skip-black
(which would match the field name πŸŽ‰ ) Thoughts y'all?
introduce "pluggable" options
I have no idea how to make that a nondisruptive change though, thinking of our future deprecation policy. Guess that'd take thought
c
would also be nice to have a kind of fmt/lint template that give all the boiler plate stuff for free.. would also help align so they are all implemented with a consistent UX
b
I'm working on it πŸ˜›
c
k cool cool cool
b
Although
buf
breaks all the molds on this journey which is what triggered this discussion 😞
c
makes sense. also, 100 in favour of the
fmt-skip-black
arg above πŸ‘ πŸ™‚
/me slightly out of thouch with the going-on’s πŸ˜‰
b
I'm on a giant refactor of `fmt`/`lint` to accomplish several things in 2.15. Namely: β€’ Reducing some boilerplate β€’ Allowing "targetless" formatters β€’ Adding
fix
❀️ 1
πŸ‘ 2
h
I personally hate how many subsystems there are in Pants, like
python-native-code
. I think it makes it much harder to discover things. So I bias towards
buf
, one subsystem for both the fmt and lint implementations
b
@hundreds-father-404 what about pluggable options? Seems like the best-of-all-worlds
h
like PluginOption? I would loveeee that
❀️ 1
b
Hmm looks like
Helm
also kinda breaks the mold as well, in a different way. (I think I brought this up earlier). It has no subsystem version, but the FieldSet has a
skip_lint
field 😡 )
Yeah helm is interesting because it has
args
, but doesn't use them for
lint
. Presumably because
args
is for some other goal πŸ€”
Looks like `go`'s
check
support also has this quirk
Copy code
FmtSubsystem.register_plugin_options(BlackFmtPluginOptons),
yields
Copy code
$ ./pants help fmt
13:08:37.47 [INFO] Initializing scheduler...
13:08:38.26 [INFO] Scheduler initialized.

`fmt` goal options
------------------

Autoformat source code.
 
Activated by pants.core
Config section: [fmt]
 
...

  --[no-]fmt-skip-black
  PANTS_FMT_SKIP_BLACK
  skip_black
      default: False
      current value: False
      If true, don't use Black when running `./pants fmt` and `./pants lint`.

Advanced options available. You can list them by running ./pants help-advanced fmt.

Related subsystems: filter
(PR TBD)