https://github.com/bufbuild/buf-plugin-protovalidate-strict
A Buf check plugin for strictly enforcing Protovalidate annotations.
https://github.com/bufbuild/buf-plugin-protovalidate-strict
Last synced: 3 months ago
JSON representation
A Buf check plugin for strictly enforcing Protovalidate annotations.
- Host: GitHub
- URL: https://github.com/bufbuild/buf-plugin-protovalidate-strict
- Owner: bufbuild
- License: apache-2.0
- Created: 2025-06-25T19:55:43.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-28T20:20:42.000Z (about 1 year ago)
- Last Synced: 2025-08-10T08:20:28.138Z (11 months ago)
- Language: Go
- Size: 21.5 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# buf-plugin-protovalidate-strict
An experimental [Buf check plugin](https://buf.build/docs/cli/buf-plugins) for [Protovalidate](https://buf.build/docs/protovalidate) that enforces:
- Protovalidate annotations are not added to existing fields and messages without Protovalidate annotations.
- Existing Protovalidate annotations are never modified or removed.
- New fields on existing messages do not get added with [`required`](https://buf.build/docs/reference/protovalidate/rules/field_rules/#required).
This plugin only allows Protovalidate annotations to be added to new fields.
This guarantees safety in Protovalidate annotation evolution via the strictest means possible. Generally, this level of strictness is not required and is not even desirable.
The single rule `PROTOVALIDATE_STRICT` must be added to `buf.yaml` to enable this check:
```
version: v2
breaking:
use:
- FILE # Or whatever your existing rules are
- PROTOVALIDATE_STRICT
plugins:
- plugin: buf-plugin-protovalidate-strict
```
Then, install this plugin locally:
```bash
go install github.com/bufbuild/buf-plugin-protovalidate-strict@latest
```
You can also [publish this plugin to your enterprise BSR instance](https://buf.build/docs/cli/buf-plugins/publish) and use it without installing it locally.
## Status: Alpha
buf-plugin-protovalidate-strict is an experimental plugin and is in active development. It may be changed or archived without notice.
## Legal
Offered under the [Apache 2 license](https://github.com/bufbuild/buf-plugin-protovalidate-strict/blob/main/LICENSE).