Add pre-commit with ruff, mypy, and standard hooks

- ruff check + format with ALL rules (ignoring D, ANN, FBT, T201)
- mypy strict mode with pydantic plugin
- Standard pre-commit hooks (trailing whitespace, end-of-file, etc.)
- Fix all type annotations for strict mypy compliance
This commit is contained in:
Bas Nijholt
2025-12-11 09:22:41 -08:00
parent 4baf908b36
commit 72faa02f15
6 changed files with 363 additions and 44 deletions

27
.pre-commit-config.yaml Normal file
View File

@@ -0,0 +1,27 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- id: check-merge-conflict
- id: debug-statements
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.4
hooks:
- id: ruff
args: [--fix]
- id: ruff-format
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.14.0
hooks:
- id: mypy
additional_dependencies:
- pydantic>=2.0.0
- typer>=0.9.0
- asyncssh>=2.14.0
- types-PyYAML