You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now Subsystem options, Goal options and Target fields are unrelated and therefore inconsistent.
This means that every backend has to define it's own options for all the levels and make sure they all work together nicely.
Problems with --filter
Simple filtering on cli works:
pants lint --filter-target-type=python_source ::
Now imagine you want to do the same thing in pants.toml, how do you do that? I would expect this to work:
[lint]
filter-target-type = ["python_source"]
But it doesn't, because lint goal doesn't have filter-target-type option, for some reason filter is a subsystem of it's own:
[filter]
target_type = ["python_source"]
This means you can't control individual goals filter options.
Problems with skip
Filtering linters to run happens on all 3 layers of options.
To choose one single linter in CLI you can use only option in lint goal subsystem:
pants lint --only=shfmt ::
To skip one single linter it has to implement skip option in it's own subsystem:
pants lint --shfmt-skip ::
To skip one single target the target itself has to implement skip field:
shell_sources(skip_shfmt=True)
Inconsistencies between options and fields
In general, there are many options that are present in subsystem, but missing in the target, and vise versa. For example, there is a verbosity option in pex subsystem, but the option is missing in pex_binary. On the other hand pex_binary has layout field that is missing in pex subsystem.
Environments
This inconsistency probably involves interaction with environments too.
The solution
Not sure how to fix it, but it will probably require redesigning a bunch of pieces including core into a sound option hierarchy. TODO
The text was updated successfully, but these errors were encountered:
The problems
Right now
Subsystem
options,Goal
options andTarget
fields are unrelated and therefore inconsistent.This means that every backend has to define it's own options for all the levels and make sure they all work together nicely.
Problems with
--filter
Simple filtering on cli works:
Now imagine you want to do the same thing in
pants.toml
, how do you do that? I would expect this to work:But it doesn't, because
lint
goal doesn't havefilter-target-type
option, for some reasonfilter
is a subsystem of it's own:This means you can't control individual goals filter options.
Problems with
skip
Filtering linters to run happens on all 3 layers of options.
To choose one single linter in CLI you can use
only
option inlint
goal subsystem:To skip one single linter it has to implement
skip
option in it's own subsystem:To skip one single target the target itself has to implement
skip
field:Inconsistencies between options and fields
In general, there are many options that are present in subsystem, but missing in the target, and vise versa. For example, there is a verbosity option in
pex
subsystem, but the option is missing inpex_binary
. On the other handpex_binary
haslayout
field that is missing inpex
subsystem.Environments
This inconsistency probably involves interaction with environments too.
The solution
Not sure how to fix it, but it will probably require redesigning a bunch of pieces including core into a sound option hierarchy. TODO
The text was updated successfully, but these errors were encountered: