Hi folks, I am trying to exclude certain paths fro...
# general
b
Hi folks, I am trying to exclude certain paths from linting protobuf. I added the following configuration but it throws errors like "Failure: path "something" has no matching file in the image". however if i use
buf
directly with the command line argument, it works. so how to correctly exclude paths in pants?
Copy code
[buf]
lint_args = [
    "--exclude-path=something",
]
h
Hi there, the intended way to exclude things is the
skip_buf_format
and
skip_buf_lint
fields. For example, this is how you do it with Python tools https://www.pantsbuild.org/docs/python-linters-and-formatters#running-only-certain-formatters-or-linters
I think it would be helpful if we eagerly detected when
--exclude-path
is being used and warned or errored. Would you mind please suggesting that in a ticket? https://github.com/pantsbuild/pants/issues/new/choose
b
sure created a ticket
it works with
protobuf_sources(skip_buf_lint=True)
on intended directories
❤️ 1
h
Thank you for opening https://github.com/pantsbuild/pants/issues/16664! Would you have any interest in submitting a PR? I added some notes on how to do it, it's a smaller ticket https://www.pantsbuild.org/docs/contributor-overview for our contributor guide