# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
#
repos:
- repo: local
  hooks:
  - id: license
    name: Check for license headers
    entry: ./ci/license-header.py
    language: python
    files: '\.(h|c|cpp|cc|spicy|evt)$'
    types: [file]
    exclude: '^(testing/btest/(Baseline|plugins|spicy|scripts)/.*|testing/builtin-plugins/.*)$'

  - id: btest-command-commented
    name: Check that all BTest command lines are commented out
    entry: '^\s*@TEST-'
    language: pygrep
    files: '^testing/btest/.*$'

- repo: https://github.com/pre-commit/mirrors-clang-format
  rev: v20.1.8
  hooks:
  - id: clang-format
    types_or:
      - "c"
      - "c++"
      - "json"

- repo: https://github.com/maxwinterstein/shfmt-py
  rev: v3.12.0.1
  hooks:
    - id: shfmt
      args: ["-w", "-i", "4", "-ci"]

- repo: https://github.com/astral-sh/ruff-pre-commit
  rev: v0.12.8
  hooks:
    - id: ruff-check
      args: ["--fix"]
    - id: ruff-format

- repo: https://github.com/cheshirekow/cmake-format-precommit
  rev: v0.6.13
  hooks:
  - id: cmake-format

- repo: https://github.com/crate-ci/typos
  rev: v1.35.3
  hooks:
    - id: typos
      exclude: '^(.typos.toml|src/SmithWaterman.cc|testing/.*|auxil/.*|scripts/base/frameworks/files/magic/.*|CHANGES|scripts/base/protocols/ssl/mozilla-ca-list.zeek)$'

- repo: https://github.com/bbannier/spicy-format
  rev: v0.26.0
  hooks:
    - id: spicy-format
      exclude: '^testing/.*'
