feat: add pre-commit hooks for linting

- Add .pre-commit-config.yaml with ruff and black hooks
- Add pre-commit git hook script as fallback
- Add pre-commit to requirements-dev.txt

Running 'pre-commit install' will auto-lint on every commit.
This commit is contained in:
Bu5hm4nn
2026-04-01 13:50:39 +02:00
parent 79d19f14ef
commit 9af654d9f2
2 changed files with 27 additions and 0 deletions

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

@@ -0,0 +1,26 @@
# Pre-commit hooks for vault-dash
# Install: pip install pre-commit && pre-commit install
repos:
# Ruff - fast Python linter
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.11.2
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
files: ^(app|tests|scripts)/
# Black - Python formatter
- repo: https://github.com/psf/black
rev: 25.1.0
hooks:
- id: black
files: ^(app|tests|scripts)/
# Type checking with mypy (optional, slower)
# Uncomment to enable:
# - repo: https://github.com/pre-commit/mirrors-mypy
# rev: v1.15.0
# hooks:
# - id: mypy
# args: [--ignore-missing-imports]
# files: ^app/

View File

@@ -8,3 +8,4 @@ mypy>=1.8.0
types-requests>=2.31.0
httpx>=0.26.0
playwright>=1.55.0
pre-commit>=3.6.0