Pre-commit Hooks

8Vast lints your staged files before every commit. If there are errors, the commit is blocked. Warnings pass through.

Install

8v hooks install

This creates a git pre-commit hook at .8v/hooks/pre-commit and tells git to use it.

8v init does this automatically when you set up a new project.

How it works

When you run git commit, the hook runs:

8v lint --staged --fail-on error .

Only files you're committing are checked — not the entire project.

If lint finds errors:

staged: 2 files to lint
./src/auth.rs:42:1: error [no-bare-unwrap] .unwrap() is banned

Commit blocked by lint errors.
  Fix:     address the errors above
  Explain: 8v lint explain no-bare-unwrap
  Skip:    git commit --no-verify

Configure

In .8v/config.yaml:

lint:
  on_commit: true      # enable/disable the hook
  on_build: true       # lint before 8v build
  block_on: error      # error, warning, or never

Remove

8v hooks uninstall

Check status

8v hooks status

Replacing Husky or Lefthook

If your project uses Husky or Lefthook, 8Vast hooks cover the same use cases. When you run 8v hooks install, it detects these tools and tells you how to switch.

Next

  • Lint — Lint rules and configuration
  • Workflows — Automate AI tasks