Skip to content

Maintenance

Updating Tool Versions

Re-run setup.sh to update all tools to latest versions:

sudo ./setup.sh /path/to/project

Adding a New Language

  1. Add entry to config/hooks.jsonlanguages section
  2. Add file matching in hooks/pre-commit (format + lint blocks)
  3. Add extensions to config/license-templates.json if headers apply
  4. Add editor rules to .editorconfig
  5. Add install steps to setup.sh
  6. Add lint config to Tools/Git/Lint/settings.json
  7. Document in docs/config-reference.md

Adding a New Repo to void-filter

cd /path/to/repo
git config core.hooksPath /path/to/void-filter/hooks

Option B: Use install script

./install.sh /path/to/repo

Modifying Lint Rules

C/C++ (.clang-format.yml)

  1. Edit .clang-format.yml in void-filter
  2. Test: clang-format --style=file:path/to/.clang-format.yml test.cpp
  3. Consider coordinating a "reformat" commit if rules change significantly

Python (ruff.toml)

Edit ruff.toml. Changes apply immediately on next commit.

Go

Go formatting is handled by gofmt/goimports no configuration needed.

Troubleshooting

Issue Fix
Hook not running Check: git config core.hooksPath should point to void-filter/hooks
"clang-format not found" Re-run sudo ./setup.sh /path/to/project
"ruff not found" pip install ruff (may need --break-system-packages on Ubuntu 23+)
Hook too slow Check config/hooks.json disable checks you don't need
Skip hooks once git commit --no-verify

Architecture

hooks/           → Bash scripts (entry points for git)
config/          → JSON configuration (hooks.json, license-templates.json)
Tools/Git/Lint/  → Python lint engine (legacy, still functional)
Tools/Git/Headers/ → Python header engine (legacy, still functional)
Tools/Git/Util/  → Shared Python utilities

The hooks/ directory is the primary entry point. The Tools/ directory contains the legacy Python-based lint and header engine which can still be used via the HookManager Python interface for more complex setups.