# Install pre-commit hooks via
# pre-commit install

exclude: (graphviz.py|graphviz_wrap.c)

repos:
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: 2c9f875913ee60ca25ce70243dc24d5b6415598c # frozen: v4.6.0
    hooks:
      - id: trailing-whitespace
      - id: end-of-file-fixer
      - id: debug-statements
      - id: check-ast
      - id: mixed-line-ending
      - id: check-yaml
        args: [--allow-multiple-documents]
      - id: check-json
      - id: check-toml
      - id: check-added-large-files

  - repo: https://github.com/rbubley/mirrors-prettier
    rev: 1463d990e0801964764a375260dca598513f3be5 # frozen: v3.3.3
    hooks:
      - id: prettier
        files: \.(md|rst|yml|yaml)
        args: [--prose-wrap=preserve]

  - repo: https://github.com/astral-sh/ruff-pre-commit
    rev: 03d82ba032f800c7cbbef301ec1e1e25c0ac91b0 # frozen: v0.6.4
    hooks:
      - id: ruff
        args: ["--fix", "--show-fixes", "--exit-non-zero-on-fix"]
      - id: ruff-format

  - repo: https://github.com/adamchainz/blacken-docs
    rev: 4c97c4a0d921007af6fefae92d8447cfbf63720b # frozen: 1.18.0
    hooks:
      - id: blacken-docs
