exclude: ^(data/.*|.vscode/.*|poetry.lock)$ default_language_version: python: python3.11 repos: - repo: https://github.com/commitizen-tools/commitizen # Please run `pre-commit install --hook-type commit-msg` to check commit messages rev: v3.20.0 hooks: - id: commitizen - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.5.0 hooks: - id: check-yaml - id: check-json - id: check-toml - id: end-of-file-fixer - id: trailing-whitespace - id: detect-private-key - id: check-case-conflict - id: check-ast - id: check-added-large-files args: ["--maxkb=1000"] # Integrate filename spell checking https://github.com/streetsidesoftware/cspell/issues/3063 # currently using `make cspell-filenames` as a workaround. - repo: https://github.com/streetsidesoftware/cspell-cli.git rev: v8.6.0 hooks: - id: cspell name: cspell additional_dependencies: - "@cspell/dict-de-ch" - "@cspell/dict-en-gb" args: - "lint" - "--show-suggestions" - "--no-must-find-files" - "--locale" - "en-GB,de-CH" - repo: https://github.com/hadolint/hadolint rev: v2.12.1-beta hooks: - id: hadolint - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.3.4 hooks: - id: ruff types_or: [python, pyi, jupyter] args: ["--fix"] # to be replaced by https://github.com/astral-sh/ruff/issues/458 - repo: https://github.com/jsh9/pydoclint rev: 0.4.1 hooks: - id: pydoclint - repo: https://github.com/asottile/pyupgrade rev: v3.15.2 hooks: - id: pyupgrade args: [--py311-plus] - repo: https://github.com/hadialqattan/pycln rev: v2.4.0 hooks: - id: pycln name: pycln (python) args: [--config=pyproject.toml] - repo: local hooks: - id: poetry-install name: Install project deps entry: poetry install language: system always_run: false types: [python] pass_filenames: false stages: [commit, merge-commit, push, manual] - id: mypy name: Run mypy entry: poetry run mypy ocma language: system always_run: false types: [python] pass_filenames: false stages: [commit, merge-commit, push, manual] - id: pylint name: Run pylint entry: poetry run pylint -j 0 ocma language: system always_run: false types: [python] pass_filenames: false stages: [commit, merge-commit, push, manual] - id: run-tests name: Run tests entry: poetry run pytest language: system always_run: false types: [python] pass_filenames: false stages: [commit, merge-commit, push, manual]