Quick guide for new contributors.
Run this single command to set up all development hooks:
pip install pre-commit && pre-commit install --hook-type commit-msg --hook-type pre-commit --hook-type post-checkoutWhat this does:
- Installs pre-commit (if not already installed)
- Enables automatic validation on every commit
- Enables branch name validation
- Enables code quality checks
Format: <type>-<description>
Valid types: feat, fix, docs, style, refactor, perf, test, build, ci, chore
Examples:
git checkout -b feat-add-buffer-pooling ✅
git checkout -b fix-memory-leak ✅
git checkout -b docs-update-readme ✅
git checkout -b my-branch ❌ (no type prefix)Format: <type>(<scope>): <subject>
Examples:
git commit -m "feat(memory): add buffer pooling" ✅
git commit -m "fix(build): correct DLL exports" ✅
git commit -m "docs(readme): update setup guide" ✅
git commit -m "update code" ❌ (no type)After setup, the hooks will:
-
On
git checkout -b new-branch:- ✅ Validate branch name format
- ❌ Reject invalid branch names with helpful error
-
On
git commit:- ✅ Format C++ code with clang-format
- ✅ Check for trailing whitespace, large files, etc.
- ✅ Validate commit message format
- ❌ Reject invalid commits with helpful error
Works on:
- ✅ macOS (zsh, bash)
- ✅ Linux (bash, zsh, sh)
- ✅ Windows (Git Bash, PowerShell, WSL)
Requirements:
- Python 3.6+ (comes with most systems)
- Git (already have it if you cloned the repo)
- pip (to install pre-commit)
pip install pre-commit
# or
pip3 install pre-commitchmod +x .githooks/*.py
chmod +x .githooks/*.shgit commit --no-verify -m "WIP: work in progress"See .pre-commit-setup.md for complete documentation.
See README.md for build and development instructions.