---
exclude: (assets/custom-frontend.tar.gz)|(assets/dependencies)|(assets/squirro.toolbox-.*)|(common)|(exchange_plugin)|(patches)|(squirro-ansible)|(test-data)
fail_fast: true
repos:
  - repo: https://github.com/commitizen-tools/commitizen
    rev: v3.29.0
    hooks:
      - id: commitizen
      - id: commitizen-branch
        stages: [push]
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v4.6.0
    hooks:
      - id: check-added-large-files
      - id: check-ast
      - id: check-builtin-literals
      - id: check-case-conflict
      - id: check-docstring-first
      - id: check-executables-have-shebangs
      - id: check-json
      - id: check-merge-conflict
      - id: check-shebang-scripts-are-executable
      - id: check-symlinks
      - id: check-toml
      - id: check-xml
      - id: check-yaml
      - id: debug-statements
      - id: destroyed-symlinks
      - id: detect-private-key
      - id: end-of-file-fixer
      - id: fix-byte-order-marker
      - id: mixed-line-ending
      - id: name-tests-test
      - id: no-commit-to-branch
        args:
          - -b=main
      - id: pretty-format-json
        args:
          - --autofix
      - id: requirements-txt-fixer
      - id: trailing-whitespace
  # Python
  - repo: https://github.com/pre-commit/pygrep-hooks
    rev: v1.10.0
    hooks:
      - id: python-check-blanket-noqa
      - id: python-check-blanket-type-ignore
      - id: python-check-mock-methods
      - id: python-no-eval
      - id: python-no-log-warn
      - id: python-use-type-annotations
  - repo: https://github.com/asottile/pyupgrade
    rev: v3.17.0
    hooks:
      - id: pyupgrade
        args:
          - "--py311-plus"
  - repo: https://github.com/astral-sh/ruff-pre-commit
    rev: v0.6.6
    hooks:
      - id: ruff
      - id: ruff-format
  - repo: https://github.com/pycqa/flake8
    rev: 7.1.0
    hooks:
      - id: flake8
        additional_dependencies:
          - flake8-bugbear
          - flake8-comprehensions
          - flake8-json
          - flake8-print
          - flake8-pyi
          - pep8-naming
  - repo: https://github.com/PyCQA/bandit
    rev: 1.7.9
    hooks:
      - id: bandit
        args:
          - -c=.bandit.yml
          - -r
  - repo: local
    hooks:
      - id: pylint
        name: pylint
        entry: pylint
        exclude: (.*test.*)|(conftest.py)
        language: system
        types: [python]
  - repo: local
    hooks:
      - id: mypy
        name: mypy
        entry: mypy
        exclude: (.*test.*)|(conftest.py)|(deployment/remote_automl_classifier/)
        language: system
        types: [python]
        args:
          - --config-file=.mypy.ini
  - repo: local
    hooks:
      - id: pytest
        name: pytest
        entry: pytest
        language: system
        pass_filenames: false
        types: [python]
  # Shell
  - repo: https://github.com/maxwinterstein/shfmt-py
    rev: v3.7.0.1
    hooks:
      - id: shfmt
  - repo: https://github.com/shellcheck-py/shellcheck-py
    rev: v0.10.0.1
    hooks:
      - id: shellcheck
  # YAML
  - repo: https://github.com/adrienverge/yamllint.git
    rev: v1.35.1
    hooks:
      - id: yamllint
        args:
          - --strict
          - -c=.yamllint.yml
  # Ansible
  - repo: local
    hooks:
      - id: ansible-lint
        name: ansible-lint
        entry: bash -c "cd deployment/ansible && ansible-lint -c .ansible-lint.yml"
        files: deployment/ansible
        language: system
