ambitious-actor-36781
08/29/2022, 2:38 AMPantsTargetProcess
that took an Address
instead of a .exewide-midnight-78598
08/29/2022, 12:25 PMIs it better to convert stuff to pex_binary targets, and then somehow call those?Are you referring to the targets you're calling tooling upon? Or the new linters themselves?
around calling executables that have been installed...The pattern for Python lint/fm tooling (and other languages, if those support pip installs) is for your newly defined Subsystem to be used to create a pex which is then called inside your rules. I was also able to get away with this with
clang-format
Is that what you're referring to as well, or do you mean system installed tools?
Or, do you mean creating custom lint/fmt code in the plugin itself?enough-analyst-54434
08/29/2022, 2:13 PMwitty-crayon-22786
08/29/2022, 4:36 PMCurrently we’ve built all our tooling around just doing it in straight python. but it seems unidiomatic, and is even causing problems (ie. im building a custom linter and cant work out how to get pants to show its output)if you are running
@rule
code which is intended to have side-effects, you’ll need to watch out for how things are marked as cacheable.
for example: LintResults
extends EngineAwareReturnType
and sets `cacheable=False`: https://github.com/pantsbuild/pants/blob/eeb3fd97710c9f37fd7344ee584f263065ac33e7/src/python/pants/core/goals/lint.py#L160-L162 … to indicate that the the @rule
that produces it should always re-run to render its messagewitty-crayon-22786
08/29/2022, 4:37 PMLintResult
ambitious-actor-36781
08/29/2022, 9:46 PMProcess
we're just importing and calling the python directly.
Which in the case of a linter, means faking an exception/return into something that looks like a ProcessResult
enough-analyst-54434
08/30/2022, 12:16 AMenough-analyst-54434
08/30/2022, 12:16 AMenough-analyst-54434
08/30/2022, 12:17 AMambitious-actor-36781
08/30/2022, 12:18 AMenough-analyst-54434
08/30/2022, 12:20 AMenough-analyst-54434
08/30/2022, 12:25 AMenough-analyst-54434
08/30/2022, 12:27 AMambitious-actor-36781
08/30/2022, 12:58 AMenough-analyst-54434
08/30/2022, 1:32 AMambitious-actor-36781
08/30/2022, 3:04 AM