fail_fast: true

exclude: |
  (?x)^(
    .*/(snapshots)/.*|
  )$

repos:
  - repo: https://github.com/abravalheri/validate-pyproject
    rev: 4b2e70d08cb2ccd26d1fba73588de41c7a5d50b7 # frozen: v0.25
    hooks:
      - id: validate-pyproject

  - repo: https://github.com/crate-ci/typos
    rev: bee27e3a4fd1ea2111cf90ab89cd076c870fce14 # frozen: v1.48.0
    hooks:
      - id: typos

  - repo: local
    hooks:
      - id: rustfmt
        name: rustfmt
        entry: rustfmt
        language: system
        types: [rust]

  - repo: local
    hooks:
      - id: cargo-dev-generate-all
        name: cargo dev generate-all
        entry: cargo dev generate-all
        language: system
        types: [rust]
        pass_filenames: false
        files: ^crates/(uv-cli|uv-settings)/

  - repo: local
    hooks:
      - id: prettier
        name: prettier
        entry: prettier --write --ignore-unknown
        language: node
        additional_dependencies: ["prettier@3"]
        types_or: [yaml, json5]

  - repo: https://github.com/astral-sh/ruff-pre-commit
    rev: 2700fd5671c633760d912769c041bfcde2b9a01b # frozen: v0.15.22
    hooks:
      - id: ruff-format
      - id: ruff
        args: [--fix, --exit-non-zero-on-fix]
