A generic and flexible linter tool written in Rust. The genlint supports multiple rules, formats, and input sources.
- Check for common issues such as:
- Automatic binary file detection and skipping
- Configurable rule disabling
- Input from stdin or multiple files
- Outputs in
plain,json, orjsonlformats - Shell completions for Bash, Zsh, Fish, and PowerShell
See HELP.md for full CLI usage documentation.
# Lint all Rust files
genlint --input "src/**/*.rs" --format plain
# Lint from stdin
cat main.rs | genlint --stdin --format json
# Disable certain checks
genlint --input "src/**/*.rs" --disable long-line,consecutive-blank
# Use JJ conflict marker style
genlint --input "src/**/*.rs" --conflict-marker-style jjmixed-indent: Detect mixed tabs and spacestrailing-space: Detect trailing whitespaces or tabsconflict-marker: Detect conflict markers (configurable style: git, git-diff3, jj, jj-diff3, jj-snapshot)long-line: Warn when line exceeds a max length (default: 120)consecutive-blank: Warn if more than two consecutive blank linesfinal-newline: Warn if missing newline at EOF
The genlint automatically detects binary files by checking for null bytes (\0) in the first 8KB of content.
Binary files are skipped by default to avoid processing non-text content.
Use the --text flag to force processing of files as text, even if binary content is detected.
Control characters (except newlines and carriage returns) are displayed as dots (.) in diagnostic output.
genlint generate-completion bash > _genlint
source ./_genlintReplace bash with zsh, fish, or powershell as needed.
The project is using MIT License.