Is there a built-in way for Pants to give a list o...
# general
b
Is there a built-in way for Pants to give a list of files that it doesn't currently cover? I'm thinking of ways to prevent, say, adding a new shell script that and forgetting to add / modify a BUILD file to make sure that it gets linted, formatted, etc.
👀 1
I can cook up something with
Copy code
comm -13 \
    <(./pants filedeps :: | sort) \
    <(git ls-tree -r HEAD --name-only | sort)
Curious if there's something a tad more elegant I'm overlooking, though.
h
Running
./pants tailor
would generate the missing BUILD file targets
And it now (in the latest dev release) has a
--check
mode where it just writes to the console which changes it would have made
So, that maybe?
c
You can run
./pants tailor --check
Copy code
$ ./p tailor --check
Would create BUILD:
  - Add python_requirements target requirements.txt

To fix `tailor` failures, run `./pants tailor`.
haha, yeah, Benjy beat me to it.. I found a bug in one of my PR’s while authoring this reply.. 😛
b
🤔 I'll give that a try... thanks!
I've tried 2.8.0rc0 and 2.8.0.dev5, and neither seems to have the
--check
option
would there also be a way to tell Pants to not try and create targets in some cases? I have some things it's trying to create
pex_binary
entries for that I don't really need.
h
The upcoming 2.8 rc will have --check, along with --ignore-paths and --ignore-adding-targets so that you can ignore false positives. Planned to be released today :)
https://github.com/pantsbuild/pants/pull/13422 for an example of the ignore options
b
Nice, I'll make sure to give that a try once it lands! 👍
h
(In case you missed it, 2.8 also has
update-build-files --check
to format build files with black and to fix safe deprecations like renaming target type names. In the future, this will be unified with
tailor
so that you have a single command to make sure your BUILD files are in tip-top shape)
b
I saw that... very nice stuff
❤️ 2