# 本地 pre-commit —— 只跑秒级静态检查
# 重活（pytest / mkdocs build）在 GitHub Actions 跑
# 安装：`uv run pre-commit install`

repos:
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v5.0.0
    hooks:
      - id: check-json
        name: JSON 语法
      - id: check-yaml
        name: YAML 语法
      - id: check-toml
        name: TOML 语法
      - id: end-of-file-fixer
        name: 文件末尾换行
      - id: trailing-whitespace
        name: 清末尾空白

  - repo: https://github.com/astral-sh/ruff-pre-commit
    rev: v0.15.11
    hooks:
      - id: ruff
        name: ruff lint
        args: [--fix]
      - id: ruff-format
        name: ruff format
