hi there, is there a way to find the BUILD file th...
# general
hi there, is there a way to find the BUILD file that owns a given file?
./pants filemap
doesnt return anything for me
./pants --owner-of=given/file.txt list
worked brilliantly
thank you!
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
oh nice. no worries at all. im always amazed at your guys' support in here
❤️ 2
👖 2
i love to hear that!!
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
you can use
./pants --changed-parent=master test
👍 1
i’m trying to think of the best way to discover these things
oh wow that command will find and run the tests for the affected files?
you guys thought of everything
🔥 2
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
FYI, we’re working to allow this.
./pants list src/python/foo.py
as a replacement to
💥 1