Is it possible to list or filter targets by what g...
# development
w
Is it possible to list or filter targets by what goal can be used to run it? Like
./pants list package
would list all targets that are "packagable",
./pants list test
would list all testable targets (without needing to specify the exact target name like "python_test")
b
That's possible (UX nonwithstanding)
The plugin can request AllTargets, then filter it by taking the union members of those unions (PackageFieldSet and TestFieldSet) and seeing if they are applicable to the target
w
Ah okay, so there is no current user-facing way to do this. Drats
Was hoping it was currently part of the external introspection API
b
I can see a case for this as a filtering of the list goal. UX would really be the only concern
Make an issue?
w
Yep, just oot and aboot right now. Looking for other workarounds too, before potentially adding more to the API. The purpose of this is to be able to contextually select goals based on a target in my vs code plugin
I had also hoped Peek would provide this type of info, but it doesn’t look like there is an external representation of what goals can run on a target, in general
b
We should probably think about modeling the CLI between stable information-driven script support and intuitive ux-driven user support
w
Yep, I have a whole thing on this ready for the next meeting. Not the solution, just some notes about my experience, and some interesting user-facing experience(s)