ci:
  autoupdate_schedule: monthly
  autoupdate_commit_msg: "chore: update pre-commit hooks"
  autofix_commit_msg: "style: pre-commit fixes"

repos:
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v6.0.0
    hooks:
      - id: check-case-conflict
      - id: check-ast
      - id: check-docstring-first
      - id: check-executables-have-shebangs
      - id: check-added-large-files
      - id: check-case-conflict
      - id: check-merge-conflict
      - id: check-json
      - id: check-toml
      - id: check-yaml
      - id: debug-statements
      - id: end-of-file-fixer
      - id: trailing-whitespace

  - repo: https://github.com/python-jsonschema/check-jsonschema
    rev: 0.37.4
    hooks:
      - id: check-github-workflows

  # Keep `rev` in sync with ZIZMOR_VERSION in .github/workflows/zizmor.yml.
  - repo: https://github.com/zizmorcore/zizmor-pre-commit
    rev: v1.29.0
    hooks:
      - id: zizmor
        # Online audits need a GitHub token and network access, neither of which
        # is dependable here (pre-commit.ci runs sandboxed, and a contributor's
        # token may not reach the shared Jupyter action repos). The zizmor
        # workflow runs them in CI instead.
        args: ["--offline"]

  - repo: https://github.com/hukkin/mdformat
    rev: 1.0.0
    hooks:
      - id: mdformat

  - repo: https://github.com/pre-commit/mirrors-prettier
    rev: "v4.0.0-alpha.8"
    hooks:
      - id: prettier
        types_or: [yaml, html, json]

  - repo: https://github.com/adamchainz/blacken-docs
    rev: "1.20.0"
    hooks:
      - id: blacken-docs
        additional_dependencies: [black==26.5.1]

  - repo: https://github.com/codespell-project/codespell
    rev: "v2.4.3"
    hooks:
      - id: codespell
        args: ["-L", "sur,nd,assertin"]

  - repo: https://github.com/pre-commit/pygrep-hooks
    rev: "v1.10.0"
    hooks:
      - id: rst-backticks
      - id: rst-directive-colons
      - id: rst-inline-touching-normal

  - repo: https://github.com/pre-commit/mirrors-mypy
    rev: "v2.3.0"
    hooks:
      - id: mypy
        files: "^nbformat"
        stages: [manual]
        additional_dependencies:
          ["jsonschema>=2.6", "traitlets>=5.13", "jupyter_core>5.4"]

  - repo: https://github.com/astral-sh/ruff-pre-commit
    rev: v0.16.1
    hooks:
      - id: ruff-check
        types_or: [python, jupyter]
        exclude: "tests/.*.ipynb"
        args: ["--fix", "--show-fixes"]
      - id: ruff-format
        exclude: "tests/.*.ipynb"
        types_or: [python, jupyter]

  - repo: https://github.com/scientific-python/cookie
    rev: "2026.06.18"
    hooks:
      - id: sp-repo-review
        additional_dependencies: ["repo-review[cli]"]
