zaplint
is a Go static analysis tool that ensures consistent code style when using the zap
logging library.
- Enforce capitalized log messages.
- Enforce replacing
zap.Any
with the appropriate type. - Enforce a single key naming convention: snake_case, kebab-case, camelCase, or PascalCase.
- Exclude specified files or patterns from analysis.
To install zaplint
, use the following command:
go get github.com/rleungx/zaplint
You can run zaplint
through the following command:
zaplint -key-naming-convention kebab -capitalized-message true -replace-any true ./...
You can configure zaplint
using the following flags:
-capitalized-message
: Enforce capitalized log messages.-replace-any
: Enforce replacingzap.Any
with the appropriate type.-key-naming-convention
: Enforce a single key naming convention (snake
|kebab
|camel
|pascal
).-exclude-files
: Exclude files matching the given patterns (comma-separated).
Contributions are welcome! Please open an issue or submit a pull request.
This project is licensed under the Apache License 2.0. See the LICENSE file for details.