New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CLI does not read config file if workspace is specified #2422
Comments
Hey @Goldziher, can you tell me a bit more about your directory structure? Since you are using
If you have just a single module in your repository, I would recommend to remove buf.work, and run So for the following example:
You would simply run But I might be off on what you actually need. Happy to hear about details 🙂 |
So, what I had is
I use a monorepo with top level configs, and I generate all output into a The reason I had to use
rather than
|
Ah, I think I see the issue. It is perfectly valid to move your proto files into a sub-directory like
I suppose you started with:
Now you run .
├── buf.gen.yaml
├── buf.yaml
├── gen
│ └── proto
│ └── x.pb.go
└── proto
└── x.proto It's understandable that you wouldn't want that. We definitely recommend to avoid it too! The most simple solution is to move buf.yaml into the proto directory:
Now you run
If you don't want to append Apologies for the bumpy start. We will likely improve how workspaces work soon, so that it's much less likely to run into such a situation. |
Its all good, thanks a bunch. So for my use case - I really hate to move the buf.yaml file into the proto folder - i want to have all configs top level. Frankly, I dont think I need a buf.work.yaml file since I intend to have a single proto folder for the time being. Some feature requests I would like to make (perhaps one or the other) - I would be happy to open issues if any of them are relevant:
|
Heard you on point 1 and 2. Point three has some less-obvious complications: Consider a plugin a generating |
I would consider adding per source overrides. This also relates to the other issue I opened --> #2432 Basically, when using monorepos of multiple languages, you might want to control the outputs in a more granular way - apply certain plugins only to certain files, and perhaps output files to different places based on the source files. |
You can do that today with the following flags:
... in combination with multiple template files. We are working on making this functionality available in configuration, so that you do not end up with many command line calls 🙂
Again, this is best to reason about on a concrete example. If you have |
I understand. What i need is not to limit to file x, but to limit to a subset of plugins for that file. |
Hi There,
I encountered a bug using the CLI to lint a project. If the
buf.work.yaml
file exists, the CLI ignores thebuf.yaml
file with the lint configuration.Trying to force loading of the configuration with
npx buf lint --config ./buf.yaml
results in:This indicates the culprit.
Expected behavior:
Even given a workspace, the lining configuration is loaded from a buf.yaml file.
The text was updated successfully, but these errors were encountered: