ancient-vegetable-10556
01/09/2023, 9:07 PMproud-dentist-22844
01/09/2023, 11:46 PMrun_in_sandbox
target up to the fmt
or fix
goals, then I would be able to delete 3 plugins I wrote. I think I mentioned this before, and lint
was feasible but `fmt`/`fix` was not…ancient-vegetable-10556
01/10/2023, 4:08 PMlint
would be feasible but weird to use.
I have a back-of-the-envelope design for making all three possible, but I don’t think that’s in scope for 2.16generic-tool
subsystem, which accepts an option that points at the `esc`/`eris` target that does the linting
• A new target called matcher(filenames=["..."])
, filenames is a list of globs that match files that can be consumed by a given `esc`/`eris`. There would be a goal that can match source files from the targets specified at the command line against the filenames
field, and treat those targets as transitive dependencies (which would get pulled into the `esc`’s execution sandbox)
• your `esc`/`eris` targets depend on the matcher
as execution_dependencies
You’d then call ./pants lint --generic-tool-linter=path/to:linter_esc …
matcher
target here would be making a synthetic target called command_line_args
that could be specified as a dependency)proud-dentist-22844
01/10/2023, 4:34 PM./pants lint ::
?
I don't want to use run
to avoid teaching people all the things they need to regularly do.ancient-vegetable-10556
01/10/2023, 4:38 PM./pants lint
would invoke the target specified by --generic-tool-linter
(by way of HydrateSources(enable_codegen=True)
). That target would have the matcher
as a dependency. That goal would resolve the targets provided by the command line specs, and either synthesise those targets as its own dependencies (ideal), or (less ideal) use codegen to return a GeneratedSources
containing all of the matched source files.lint
/`fmt`/`fix` subsystems to hydrate sources from an `esc`/`eris`
• A target & rule to yoink sources from the specs provided at the command line, so the target can be specified as a dependency to `esc`/`eris`.--generic-tool-linter
too. There’d be some ambiguity arising in fix
and fmt
when multiple targets match the same files, but that’s not too hard to overcome, I don’t think)