CLI tool for Protocol Buffer linting and style enforcement
Top 52.8% on sourcepulse
Protolint is a pluggable linter and fixer for Protocol Buffer files, designed to enforce style and conventions. It targets developers working with Protocol Buffers who need to maintain code quality and consistency, offering automatic fixes and customizable rules to streamline the development workflow.
How It Works
Protolint operates by parsing Protocol Buffer files directly, without relying on the protoc
compiler, which significantly speeds up execution. It enforces rules that align precisely with the official Protocol Buffer style guide. The tool can automatically fix many violations and allows for disabling specific rules via comments within the .proto
files, which is crucial for maintaining API compatibility during gradual adoption. Its pluggable architecture enables the integration of custom linting rules.
Quick Start & Requirements
brew tap yoheimuta/protolint && brew install protolint
docker run --volume "$(pwd):/workspace" --workdir /workspace yoheimuta/protolint lint _example/proto
go install github.com/yoheimuta/protolint/cmd/protolint@latest
npm install protolint --save-dev
pip install protolint-bin
.protolint.yaml
file for custom rules and settings.Highlighted Details
protoc
.auto_disable
comments to maintain compatibility.junit
, json
, sarif
).pre-commit
, various editors (VS Code, JetBrains IDEs, Vim), and CI/CD platforms (GitHub Actions, Jenkins).Maintenance & Community
The project is actively maintained by yoheimuta. Community interaction channels are not explicitly listed in the README, but GitHub is the primary platform for development and issues.
Licensing & Compatibility
Limitations & Caveats
Some rules are not fixable or auto-disableable, requiring manual intervention or specific configuration. The README notes that some rules might not support auto_disable
if fixes do not break compatibility, implying a need to review rule behavior.
1 week ago
1 week