Skip to content

Repository files navigation

void-filter 🔍

CI Docs Shell License

📖 Documentation: https://gauravagarwalgarg.github.io/void-filter/

📦 Repository: GitHub

Enterprise-grade Git hooks framework for polyglot codebases. Language-agnostic, org-configurable, zero lock-in.

Drop into any repo. Enforces code quality, formatting, commit conventions, license headers, and secrets detection automatically on every commit.

Supported Languages

Language Formatter Linter/Analyzer Static Analysis
C/C++ clang-format clang-tidy cppcheck
Python ruff format ruff check bandit (via ruff)
Go gofmt / goimports golangci-lint go vet
JavaScript/TS prettier eslint
Shell shfmt shellcheck
YAML yamllint
Protobuf buf format buf lint
BitBake/Yocto oelint-adv

Git Hook Stages

Hook Stage What It Does Blocks?
pre-commit Before commit created Format, lint, secrets scan ✅
prepare-commit-msg After default msg created Add ticket/branch prefix Auto
commit-msg After msg written Validate conventional commits ✅
post-commit After successful commit Notify, update metrics ❌
post-checkout After checkout/switch Rebuild deps if lockfile changed ❌
post-merge After merge Rebuild deps if lockfile changed ❌
pre-rebase Before rebase Prevent rebase of published branches ✅
pre-push Before push Run tests, check branch policy ✅

Quick Start

# Install into any git repo
./install.sh /path/to/your/project

# Or manually:
git config core.hooksPath /path/to/void-filter/hooks

Configuration

All behavior is configurable via config/hooks.json. Organizations customize:

  • License header template (or disable entirely)
  • Commit message format (Conventional Commits, Jira prefix, etc.)
  • Which checks block vs warn
  • Protected branch patterns for pre-push/pre-rebase

License Header System

The license header is fully configurable. Set your org's template in config/license-templates.json:

{
  "header_style": "spdx",
  "spdx_identifier": "Apache-2.0",
  "copyright_holder": "Your Organization",
  "year": "auto"
}

Or disable headers entirely: set "enabled": false in config/hooks.json.

Philosophy

  • Zero proprietary lock-in: No org-specific content baked in
  • Configurable, not opinionated: Every check can be enabled/disabled/tuned
  • Graceful degradation: Missing tools = skip check, not crash
  • Fast: Only checks staged files, not entire repo
  • Polyglot: Same framework for C++, Python, Go, JS, Shell

Developer Shell Enhancements

Beyond hooks, void-filter installs a complete developer shell experience:

┌────────────────────────────────────────────────────────────────┐
│  user@host:~/project (main↑2|✚3●1)                           │
│  ↑ informative git prompt: branch, tracking, staged/unstaged  │
└────────────────────────────────────────────────────────────────┘

AI-Assisted Development

# Hook fails? Ask AI to fix it:
$ git commit -m "feat: add auth"
✗ Pre-commit: 2 check(s) failed. Fix issues and retry.
💡 Hook failed. Run 'vf-ai-fix' for AI-assisted resolution.

$ vf-ai-fix
🤖 Analyzing hook errors with ollama (codellama)...
Fix commands:
  ruff format src/auth.py
  goimports -w internal/handler.go

# Let AI write your commit message:
$ vf-ai-commit
🤖 Generating commit message...
Suggested: feat(auth): implement JWT token validation middleware
Use this message? [Y/n/e]

Productivity Tools

Tool What Command
Branch from ticket Create properly-named branches gbranch feat PROJ-123 "add auth"
Test auto-detect Runs whatever test system exists test-here
WIP checkpoint Quick save without hooks gwip / gunwip
Diff from main See all changes since branch gdiff-main
Large file check Catch accidental binaries check-large-files

Requires: bash shell/install-shell.sh (included in ./setup.sh)

About

Git hooks toolkit: code quality, commit standards, developer experience

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages