repos:
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v5.0.0
    hooks:
      - id: end-of-file-fixer
  - repo: https://github.com/psf/black
    rev: 25.1.0
    hooks:
      - id: black
        alias: python
        files: ^backend/
        args: ["--line-length=79"]
  - repo: https://github.com/pycqa/isort
    rev: 6.0.1
    hooks:
      - id: isort
        name: isort (python)
        alias: python
        files: ^backend/
        args: ["--profile", "black", "-l 79"]
  - repo: https://github.com/pycqa/flake8
    rev: 7.1.2
    hooks:
      - id: flake8
        alias: python
        files: ^backend/
        args: ["--max-complexity=10", "--max-line-length=79"]
  - repo: https://github.com/codespell-project/codespell
    rev: v2.4.1
    hooks:
      - id: codespell
        exclude: ^frontend/package-lock.json
  - repo: https://github.com/pre-commit/mirrors-eslint
    rev: v9.22.0
    hooks:
      - id: eslint
        name: eslint
        files: \.[jt]sx?$
        types: [file]
        entry: npm run --prefix ./frontend lint
        pass_filenames: false
  - repo: https://github.com/pre-commit/mirrors-prettier
    rev: v4.0.0-alpha.8
    hooks:
      - id: prettier
        entry: npm run --prefix ./frontend format
        pass_filenames: false

exclude: '.*(\.svg|/migrations/).*'
