default_language_version: python: python3.11 default_stages: [commit] fail_fast: true repos: # Basic pre-commit hooks - repo: https://github.com/pre-commit/pre-commit-hooks rev: v2.3.0 hooks: - id: check-xml - id: check-yaml - id: end-of-file-fixer - id: trailing-whitespace - id: check-added-large-files - id: check-ast - id: debug-statements - id: no-commit-to-branch args: ['--branch', 'development', '--branch', 'staging', '--branch', 'production'] # Dependencies checker - repo: https://github.com/Lucas-C/pre-commit-hooks-safety rev: v1.3.2 hooks: - id: python-safety-dependencies-check files: common.txt, local.txt # isort For sorting imports - repo: https://github.com/pycqa/isort rev: 5.12.0 hooks: - id: isort - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.4.4 hooks: - id: ruff name: ruff entry: ruff check --fix language: python - id: ruff-format name: ruff-format entry: ruff format language: python # Codespell for spell checking # - repo: https://github.com/codespell-project/codespell # rev: v2.2.4 # hooks: # - id: codespell # exclude: > # (?x)^( # .*\test_*.py # )$ # Pytest for testing # - repo: local # hooks: # - id: pytest-check # stages: [commit] # types: [python] # name: pytest-check # entry: pytest # language: system # pass_filenames: false # always_run: true