# See https://pre-commit.com — run `make hooks` once after cloning to enable:
#   pre-commit install --hook-type pre-commit --hook-type pre-push --hook-type commit-msg
#
# Local hooks call `make` so the exact same gate runs locally and in CI.
repos:
  - repo: local
    hooks:
      # Format on commit — fast, so contributors don't reach for --no-verify.
      - id: fmt
        name: fmt
        entry: make fmt
        language: system
        pass_filenames: false
        stages: [pre-commit]

      # Test on push — slower correctness gate, before code leaves the machine.
      - id: test
        name: test
        entry: make test
        language: system
        pass_filenames: false
        stages: [pre-push]

  # Conventional Commits message validation.
  - repo: https://github.com/commitizen-tools/commitizen
    rev: v3.2.2
    hooks:
      - id: commitizen
        stages: [commit-msg]
