buf
buf copied to clipboard
`buf config init` that can parse the Protobuf roots of a given source directory
Feature
Having buf config init take a directory (. by default), finds all Protobuf definitions, and create a buf.yaml with the appropriate modules.
For example, I have a source repository for my project that might look something like:
.
├── LICENSE
├── README.md
├── proto
│ ├── api
│ └── vendor
└── src
Running buf config init, it would:
- Find all the Protobuf definitions
- Scans the import paths of all the files
- Figures out that there are two Protobuf roots,
apiandvendor - Produce a
buf.yamlwith the following content:
version: v2
modules:
- path: proto/api
- path: proto/vendor
This is pretty closely related to https://github.com/bufbuild/buf/issues/3159