---
repos:
  - repo: https://github.com/astral-sh/ruff-pre-commit
    rev: v0.14.10
    hooks:
      - id: ruff
        name: 🐶 Ruff lint
        args:
          - --fix
          # - --unsafe-fixes

      - id: ruff-format
        name: 🐶 Ruff format

  - repo: https://github.com/asottile/pyupgrade
    rev: v3.21.2
    hooks:
      - id: pyupgrade
        name: ⬆️  Upgrade Python syntax
        args:
          - --py312-plus

  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v6.0.0
    hooks:
      - id: check-added-large-files
        name: 🗜️  Check for added large files

      - id: check-ast
        name: 🐍 Check python ast

      - id: check-builtin-literals
        name: 🧐 Check builtin type constructor use

      - id: check-case-conflict
        name: 🔠 Check for case conflicts

      - id: check-docstring-first
        name: ℹ️  Check docstring is first

      - id: check-executables-have-shebangs
        name: 🧐 Check that executables have shebangs

      - id: check-shebang-scripts-are-executable
        name: 🧐 Check that scripts with shebangs are executable

      - id: check-merge-conflict
        name: 💥 Check for merge conflicts

      - id: check-symlinks
        name: 🔗 Check for broken symlinks

      - id: check-toml
        name: ✅ Check toml

      - id: check-xml
        name: ✅ Check xml

      - id: check-yaml
        name: ✅ Check yaml

      - id: debug-statements
        name: 🔍 Debug statements (Python)

      - id: destroyed-symlinks
        name: 🔗 Detect destroyed symlinks

      - id: detect-private-key
        name: 🕵️  Detect private key

      - id: end-of-file-fixer
        name: ⮐  Fix End of Files

      - id: fix-byte-order-marker
        name: 🧐 Fix utf-8 byte order marker

      - id: name-tests-test
        name: 🔠 Python tests naming
        args:
          - --pytest-test-first
        exclude: ^tests/syrupy.py

      - id: no-commit-to-branch
        name: 🛑 Don't commit to main branch

      - id: trailing-whitespace
        name: ✄  Trim trailing whitespace

  - repo: https://github.com/rbubley/mirrors-prettier
    rev: v3.7.4
    hooks:
      - id: prettier
        name: 💄 Ensuring files are prettier
        additional_dependencies:
          - prettier@3.6.2
          - prettier-plugin-sort-json@4.1.1
        exclude_types:
          - python
        exclude: ^uv.lock$

  - repo: https://github.com/adrienverge/yamllint.git
    rev: v1.37.1
    hooks:
      - id: yamllint
        name: 🎗  Check YAML files with yamllint

  - repo: local
    hooks:
      - id: mypy
        name: 🆎 Static type checking using mypy
        language: system
        types:
          - python
        entry: uv run mypy
        require_serial: true

      - id: prettier
        name: 💄 Ensuring files are prettier
        language: system
        types:
          - yaml
          - json
          - markdown
        entry: npm run prettier
        pass_filenames: false

      - id: pylint
        name: 🌟 Starring code with pylint
        language: system
        types:
          - python
        entry: uv run pylint

      - id: pytest
        name: 🧪 Running tests and test coverage with pytest
        language: system
        types:
          - python
        entry: uv run pytest
        pass_filenames: false
