Buf Has a Free API: Make Protocol Buffers Actually Developer-Friendly
Protobuf is powerful but painful. protoc plugins, code generation configs, import path hell — Buf fixes all of it. What Is Buf? Buf is a suite of tools for Protocol Buffers and gRPC: linting, break...

Source: DEV Community
Protobuf is powerful but painful. protoc plugins, code generation configs, import path hell — Buf fixes all of it. What Is Buf? Buf is a suite of tools for Protocol Buffers and gRPC: linting, breaking change detection, code generation, and a schema registry. Think ESLint + npm for protobuf. # Install npm install -g @bufbuild/buf # Initialize buf config init # Lint your .proto files buf lint # Generate code buf generate # Check for breaking changes buf breaking --against .git#branch=main Linting # buf.yaml version: v2 lint: use: - STANDARD except: - FIELD_LOWER_SNAKE_CASE $ buf lint pet/v1/pet.proto:10:3: Field name "petName" should be lower_snake_case pet/v1/pet.proto:14:1: Service "petService" should be PascalCase Catch naming issues, import problems, and style violations before they reach code review. Breaking Change Detection $ buf breaking --against .git#branch=main pet/v1/pet.proto:8:3: Field "1" on message "Pet" changed type from "string" to "int32". pet/v1/pet.proto:12:3: Field