<#17871 Unable to pass a buf config file while run...
# github-notifications
q
#17871 Unable to pass a buf config file while running buf linter Issue created by anteverse Describe the bug Hey, it seems we can't pass a buf config file to the
buf
linter (from the backend
pants.backend.codegen.protobuf.lint.buf
). My example: in `pants.toml`:
Copy code
[GLOBAL]
backend_packages = [
  "pants.backend.codegen.protobuf.python",
  "pants.backend.codegen.protobuf.lint.buf",
  ...
]

[buf]
lint_args = [
  "--config buf.yaml"
]
file tree:
Copy code
./
├── proto/
│   ├── user.proto
│   └── BUILD
├── pants.toml
└── buf.yaml
When running:
Copy code
./pants lint --only=buf-lint ::
I get a
Failure: could not read file: open buf.yaml: no such file or directory
. My understanding is that it fails because the argument seems to be evaluated at runtime and there's no reason the yaml file should be embedded in the sandbox as I have declared the protos with the target
protobuf_sources
which only takes
proto
files. Enabling
--keep-sandboxes=on_failure
reveals the yaml config file is not present, as expected. Maybe this could be a feature request? Like enabling a
config
param in
[buf]
section? Let me know! Also, feel free to ask for any clarification or samples. Thanks a lot! Pants version 2.14.0 OS MacOS Additional info Buf config looks like this: sample config pantsbuild/pants