Language Support¶
void-filter provides per-language formatting and linting. Configuration in config/hooks.json → languages.
Language Matrix¶
| Language | Formatter | Linter | Config File | Include Patterns | Exclude Patterns |
|---|---|---|---|---|---|
| Go | goimports | golangci-lint | .go |
vendor/, *.pb.go |
|
| C/C++ | clang-format | cppcheck | .clang-format.yml, .clang-tidy |
.c, .cpp, .h, .hpp, .cc, .cxx |
build/, third_party/ |
| Python | ruff format | ruff check | ruff.toml |
.py |
.venv/, __pycache__/ |
| JavaScript/TS | prettier | eslint | .prettierrc, .eslintrc |
.js, .ts, .jsx, .tsx |
node_modules/, dist/ |
| Shell | shfmt | shellcheck | .shellcheckrc |
.sh, .bash |
How It Works¶
pre-commithook identifies staged files- Matches file extensions against
include_patterns - Skips files matching
exclude_patterns - Runs formatter first (auto-fixes, re-stages)
- Runs linter (blocks commit on errors)
Configuration¶
Per-language settings in config/hooks.json:
"go": {
"enabled": true,
"formatter": "goimports",
"linter": "golangci-lint",
"lint_args": ["run", "--fast"],
"include_patterns": [".+\\.go$"],
"exclude_patterns": ["vendor/", "*.pb.go"]
}
Adding a New Language¶
- Add entry to
config/hooks.json→languages - Specify formatter and linter commands
- Define include/exclude regex patterns
- Install the tools on your system
- The
pre-commithook auto-detects the new language
Tool Configuration Files¶
| File | Purpose | Location |
|---|---|---|
.clang-format.yml |
C++ formatting rules | repo root |
.clang-tidy |
C++ static analysis | repo root |
ruff.toml |
Python linter/formatter config | repo root |
.shellcheckrc |
ShellCheck options | repo root |
.yamllint.yml |
YAML lint rules | repo root |
.editorconfig |
Editor-agnostic formatting | repo root |
Tools/Git/Lint/configs/ruff.toml |
Lint-specific ruff override | Tools/Git/Lint/configs/ |
Tools/Git/Lint/configs/yamllint.yml |
Lint-specific YAML override | Tools/Git/Lint/configs/ |