exclude: \.min\.(js|css)(\.map)?$|^\.idea/|/vendor/
ci:
  skip: [pip-compile]

repos:
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v4.4.0
    hooks:
      - id: check-ast
      - id: check-json
      - id: check-toml
      - id: check-xml
      - id: check-yaml
        args: [--allow-multiple-documents]
      - id: end-of-file-fixer
      - id: check-merge-conflict
      - id: debug-statements
      - id: detect-private-key
      - id: pretty-format-json
        args:
          - --autofix
          - --no-sort-keys
      - id: trailing-whitespace
        args:
          - --markdown-linebreak-ext=md
      - id: check-executables-have-shebangs
      - id: check-shebang-scripts-are-executable
  - repo: https://github.com/adamchainz/django-upgrade
    rev: 1.13.0
    hooks:
      - id: django-upgrade
        args: [--target-version, "4.1"]
  - repo: https://github.com/psf/black
    rev: 23.3.0
    hooks:
      - id: black
        args: [--target-version, py311]
  - repo: https://github.com/rtts/djhtml
    rev: 3.0.6
    hooks:
      - id: djhtml
  - repo: https://github.com/charliermarsh/ruff-pre-commit
    rev: v0.0.262
    hooks:
      - id: ruff
        args: [--fix]
  - repo: https://github.com/pre-commit/mirrors-prettier
    rev: v3.0.0-alpha.9-for-vscode
    hooks:
      - id: prettier
        types_or: [javascript, css]
  - repo: https://github.com/pre-commit/mirrors-eslint
    rev: v8.39.0
    hooks:
      - id: eslint
        args: [--fix]
        types_or: [javascript, css]
        additional_dependencies:
          - eslint@8.36.0
          - eslint-config-prettier@8.5.0
  - repo: https://github.com/tox-dev/pyproject-fmt
    rev: 0.10.0
    hooks:
      - id: pyproject-fmt
  - repo: https://github.com/jazzband/pip-tools
    rev: 6.13.0
    hooks:
      - id: pip-compile
        name: pip-compile requirements.txt
        args: [-q, --allow-unsafe, --resolver=backtracking, requirements.in]
        files: ^requirements\.(in|txt)$
      - id: pip-compile
        name: pip-compile constraints.txt
        args: [-q, --allow-unsafe, --resolver=backtracking, --strip-extras, --output-file=constraints.txt, requirements.in]
        files: ^requirements\.in|constraints\.txt$
      - id: pip-compile
        name: pip-compile requirements-dev.txt
        args: [-q, --allow-unsafe, --resolver=backtracking, requirements-dev.in]
        files: ^requirements-dev\.(in|txt)$
