https://pantsbuild.org/ logo
#general
Title
# general
r

rapid-exabyte-76685

03/31/2022, 7:28 AM
Is there a way to get
list
to show the tags that have been applied to targets/files?
I'm trying to filter the tests that are run by tag but finding that isn't working so wondering if I haven't applied the tag correctly.
n

narrow-vegetable-37489

03/31/2022, 8:37 AM
There's
./pants --tag=<tag> list ::
if you only want to show targets of a specific tag. If you want to list the tags of all targets, I suppose you could do something like:
Copy code
./pants peek :: | jq -r '.[] | select(.tags != null) | .address + ": " + (.tags | join(", "))'
👍 1
r

rapid-exabyte-76685

03/31/2022, 8:45 AM
Yeah definitely the latter is what I’m after. Would be good if I could do
./pants list --list-tags ::
w

witty-crayon-22786

03/31/2022, 4:36 PM
thanks @narrow-vegetable-37489! yea, we’ve been recommending
peek
+
jq
more and more… there are so many combinations of things that folks would like to do that the generality of
jq
is very helpful.
it’s mentioned on https://www.pantsbuild.org/docs/project-introspection#peek---programmatically-inspect-a-target … but continuing to add recipes there would probably be helpful.
1
h

hundreds-father-404

03/31/2022, 5:19 PM
big +1 to adding dozens of recipes. allows people to adapt a snippet much easier
4 Views