2024-10-03 11:01:37 +02:00
|
|
|
# Exclude some file types from automatic code style
|
|
|
|
|
exclude: \.(json|csv)$
|
|
|
|
|
repos:
|
2025-10-28 02:50:31 +01:00
|
|
|
# --- Basic sanity checks ---
|
2024-11-10 23:00:16 +01:00
|
|
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
2025-10-28 02:50:31 +01:00
|
|
|
rev: v6.0.0
|
2024-11-10 23:00:16 +01:00
|
|
|
hooks:
|
|
|
|
|
- id: check-merge-conflict
|
|
|
|
|
- id: check-toml
|
|
|
|
|
- id: check-yaml
|
|
|
|
|
- id: end-of-file-fixer
|
|
|
|
|
- id: trailing-whitespace
|
2024-11-26 00:53:16 +01:00
|
|
|
- id: check-merge-conflict
|
2025-10-28 02:50:31 +01:00
|
|
|
exclude: '\.rst$' # Exclude .rst files from whitespace cleanup
|
|
|
|
|
|
|
|
|
|
# --- Import sorting ---
|
2024-11-10 23:00:16 +01:00
|
|
|
- repo: https://github.com/PyCQA/isort
|
2026-07-15 16:38:53 +02:00
|
|
|
rev: 8.0.1
|
2024-11-10 23:00:16 +01:00
|
|
|
hooks:
|
|
|
|
|
- id: isort
|
2025-10-28 02:50:31 +01:00
|
|
|
|
|
|
|
|
# --- Linting + Formatting via Ruff ---
|
2024-11-10 23:00:16 +01:00
|
|
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
2026-07-15 16:38:53 +02:00
|
|
|
rev: v0.15.21
|
2024-11-10 23:00:16 +01:00
|
|
|
hooks:
|
2025-10-28 02:50:31 +01:00
|
|
|
# Run the linter and fix simple isssues automatically
|
2024-11-10 23:00:16 +01:00
|
|
|
- id: ruff
|
|
|
|
|
args: [--fix]
|
2025-10-28 02:50:31 +01:00
|
|
|
# Run the formatter
|
2024-11-10 23:00:16 +01:00
|
|
|
- id: ruff-format
|
2025-10-28 02:50:31 +01:00
|
|
|
|
|
|
|
|
# --- Static type checking ---
|
2024-11-26 22:28:05 +01:00
|
|
|
- repo: https://github.com/pre-commit/mirrors-mypy
|
2026-07-15 16:38:53 +02:00
|
|
|
rev: v2.3.0
|
2024-11-26 22:28:05 +01:00
|
|
|
hooks:
|
|
|
|
|
- id: mypy
|
|
|
|
|
additional_dependencies:
|
2026-07-15 16:38:53 +02:00
|
|
|
- types-requests==2.33.0.20260712
|
|
|
|
|
- pandas-stubs==3.0.3.260530
|
2025-11-13 22:53:46 +01:00
|
|
|
- tokenize-rt==6.2.0
|
2026-07-15 16:38:53 +02:00
|
|
|
- types-docutils==0.22.3.20260518
|
|
|
|
|
- types-PyYaml==6.0.12.20260518
|
2024-11-26 22:28:05 +01:00
|
|
|
pass_filenames: false
|
2025-10-28 02:50:31 +01:00
|
|
|
|
|
|
|
|
# --- Markdown linter ---
|
2025-02-12 14:24:17 +01:00
|
|
|
- repo: https://github.com/jackdewinter/pymarkdown
|
2026-07-15 16:38:53 +02:00
|
|
|
rev: v0.9.39
|
2025-02-12 14:24:17 +01:00
|
|
|
hooks:
|
|
|
|
|
- id: pymarkdown
|
|
|
|
|
files: ^docs/
|
|
|
|
|
args:
|
|
|
|
|
- --config=docs/pymarkdown.json
|
|
|
|
|
- scan
|
2025-10-28 02:50:31 +01:00
|
|
|
|
|
|
|
|
# --- Commit message linting ---
|
|
|
|
|
# - Local cross-platform hooks
|
|
|
|
|
- repo: local
|
2025-04-07 22:23:35 +02:00
|
|
|
hooks:
|
2025-10-28 02:50:31 +01:00
|
|
|
# Validate commit messages (using Python wrapper)
|
|
|
|
|
- id: commitizen-commit
|
|
|
|
|
name: Commitizen (venv-aware)
|
2026-02-23 20:59:03 +01:00
|
|
|
entry: scripts/cz_check_commit_message.py
|
|
|
|
|
language: python
|
|
|
|
|
additional_dependencies:
|
|
|
|
|
- .
|
2025-10-28 02:50:31 +01:00
|
|
|
stages: [commit-msg]
|
|
|
|
|
pass_filenames: false
|
|
|
|
|
|
|
|
|
|
# Branch name check on push (using Python wrapper)
|
|
|
|
|
- id: commitizen-branch
|
|
|
|
|
name: Commitizen branch check
|
2026-02-23 20:59:03 +01:00
|
|
|
entry: scripts/cz_check_branch.py
|
|
|
|
|
language: python
|
|
|
|
|
additional_dependencies:
|
|
|
|
|
- .
|
2025-10-28 02:50:31 +01:00
|
|
|
stages: [pre-push]
|
|
|
|
|
pass_filenames: false
|
|
|
|
|
|
|
|
|
|
# Validate new commit messages before push (using Python wrapper)
|
|
|
|
|
- id: commitizen-new-commits
|
|
|
|
|
name: Commitizen (check new commits only, .venv aware)
|
2026-02-23 20:59:03 +01:00
|
|
|
entry: scripts/cz_check_new_commits.py
|
|
|
|
|
language: python
|
|
|
|
|
additional_dependencies:
|
|
|
|
|
- .
|
2025-10-28 02:50:31 +01:00
|
|
|
stages: [pre-push]
|
|
|
|
|
pass_filenames: false
|