A plug-in for Google's Protocol Buffers (protobufs) compiler to lint .proto files for style violations.
A plug-in for Google's Protocol Buffers compiler to check
.protofiles for style violations.
This plug-in will check a
.protofile for violations of Google's Protocol Buffer Style Guide. The protobuf compiler already reports on compilation errors; by using this plug-in you are also able to retrieve those compilation error without writing any file which is be helpful for use cases like IDE integrations.
protoc-gen-lintand make sure it's available in your PATH. Once it's in your PATH,
protocwill be able to make use of the plug-in.
You must have a working version of Google's Protocol Buffers compiler
protocin your PATH. You can download it here
If you have a go environment already set up you can use
go getto install.
go get github.com/ckaznocha/protoc-gen-lint
Download the latest release for your operating system here and ensure the executable is available in your PATH.
protoc --lint_out=. *.proto
Optional checks are enabled but passing a comma separated list to the protoc "parameter". Example:
protoc --lint_out=sort_imports:. *.proto
Available optional checks: *
sort_imports- checks that imports are sorted in descending alphabetical order.