hi there, is there a way to find the BUILD file th...
# general
l
hi there, is there a way to find the BUILD file that owns a given file?
./pants filemap
doesnt return anything for me
a
./pants --owner-of=given/file.txt list
l
worked brilliantly
thank you!
a
target selection mechanisms aren’t well-documented, i’m trying to make them more discoverable in https://github.com/pantsbuild/pants/pull/7350
sorry about that
l
oh nice. no worries at all. im always amazed at your guys' support in here
❤️ 2
👖 2
a
i love to hear that!!
l
i wonder if you have a suggestion for what im trying to accomplish? or if pants has a built in method for this: I am trying to list just the test targets that would be affected by the changed files in my branch. i was thinking so far of something like this to fetch the affected targets:
git diff --name-only develop | grep ".scala" | while read f; do ./pants --owner-of=$f list; done | sort | uniq
but then i would need to walk up the dependee tree from every target to find all the test targets that transitively depend on those targets
a
you can use
./pants --changed-parent=master test
!!
👍 1
i’m trying to think of the best way to discover these things
l
oh wow that command will find and run the tests for the affected files?
you guys thought of everything
🔥 2
a
personally i usually use
./pants help-all | grep -i 'changed'
to try to see if any options might work but it takes a few tries to discover options i don’t yet know
h
FYI, we’re working to allow this.
./pants list src/python/foo.py
as a replacement to
—owner-of
:)
💥 1