Reviving a `tailor` issue I'm running into when cr...
# general
f
Reviving a
tailor
issue I'm running into when creating something with pre-commit: I'd like to just pass filenames from pre-commit, but the issue is stuff in
pants_ignore
. Anything in
pants_ignore
that shows up on the command line causes pants to error out. Example:
Copy code
❯ ./pants tailor --check aiven/README.md 
14:28:43.11 [ERROR] 1 Exception encountered:

  Exception: Unmatched glob from CLI arguments: "aiven/README.md"

Do the file(s) exist? If so, check if the file(s) are in your `.gitignore` or the global `pants_ignore` option, which may result in Pants not being able to see the file(s) even though they exist on disk. Refer to <https://www.pantsbuild.org/v2.13/docs/troubleshooting#pants-cannot-find-a-file-in-your-project>.
Is there a way to avoid this? Or do I need to filter before passing to
tailor
?
2
is
--unmatched-cli-globs=ignore
the path I want?
Yes this is what I want
h
yeah
it would be good if we could mention that option in the error message, although wiring it is a little awkward because the error message is created in Rust, so it's a lot of boilerplate to pass down the string but maybe worth it
f
Probably easier thing would be updating the docs around tailor, like how to set up a pre-commit hook, (just adding an example pre-commit hook would be great)
h
contribution definitely welcomed if you have a moment. docs are now in repo
📌 1
👍🏻 1
f
Copy code
- id: pants-tailor
      name: "Ensure BUILD metadata exists (Pants Tailor)"
      entry: ./pants --unmatched-cli-globs=ignore tailor --check
      language: system
      stages: [ commit, push ]
      pass_filenames: true