https://github.com/ckaznocha/protoc-gen-lint
A plug-in for Google's Protocol Buffers (protobufs) compiler to lint .proto files for style violations.
https://github.com/ckaznocha/protoc-gen-lint
google-protocol-buffers lint linter plugin protobuf protocol-buffers static-analysis style-linter
Last synced: 18 days ago
JSON representation
A plug-in for Google's Protocol Buffers (protobufs) compiler to lint .proto files for style violations.
- Host: GitHub
- URL: https://github.com/ckaznocha/protoc-gen-lint
- Owner: ckaznocha
- License: mit
- Created: 2015-08-09T14:50:51.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2024-12-23T22:35:00.000Z (4 months ago)
- Last Synced: 2025-04-01T00:36:56.350Z (25 days ago)
- Topics: google-protocol-buffers, lint, linter, plugin, protobuf, protocol-buffers, static-analysis, style-linter
- Language: Go
- Homepage:
- Size: 1.06 MB
- Stars: 285
- Watchers: 6
- Forks: 15
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
- awesome-grpc - protoc-gen-lint - A plug-in for Google's Protocol Buffers (protobufs) compiler to lint .proto files for style violations (Protocol Buffers / Tools)
README
# protoc-gen-lint
[](https://github.com/ckaznocha/protoc-gen-lint/actions/workflows/ci.yml)
[](https://github.com/ckaznocha/protoc-gen-lint/releases/latest)
[](http://ckaznocha.mit-license.org)
[](https://github.com/ckaznocha/protoc-gen-lint/actions/workflows/codeql-analysis.yml)
[](https://api.securityscorecards.dev/projects/github.com/ckaznocha/protoc-gen-lint)A plug-in for Google's [Protocol Buffers](https://github.com/google/protobuf)
compiler to check `.proto` files for style violations.## About
This plug-in will check a `.proto` file for violations of Google's Protocol
Buffer [Style Guide](https://developers.google.com/protocol-buffers/docs/style).
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.## Installation
Download `protoc-gen-lint` and make sure it's available in your PATH. Once it's
in your PATH, `protoc` will be able to make use of the plug-in.### Dependencies
You must have a working version of Google's Protocol Buffers compiler `protoc`
in your PATH. You can download it
[here](https://developers.google.com/protocol-buffers/docs/downloads)### Using go get
If you have a go environment already set up you can use `go get` to install.
```
go get github.com/ckaznocha/protoc-gen-lint
```### Downloading binary
Download the latest release for your operating system
[here](https://github.com/ckaznocha/protoc-gen-lint/releases/latest) and ensure
the executable is available in your PATH.## Usage
```
protoc --lint_out=. *.proto
```
### Optional Checks
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.## TODO
* Write more tests
* Find out about any common protocol buffer smells to check for from the community## Contributing
See the `CONTRIBUTING` file.## License
See `LICENSE` file