From 9af654d9f29250918853e644dd603361195dc651 Mon Sep 17 00:00:00 2001 From: Bu5hm4nn Date: Wed, 1 Apr 2026 13:50:39 +0200 Subject: [PATCH] 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. --- .pre-commit-config.yaml | 26 ++++++++++++++++++++++++++ requirements-dev.txt | 1 + 2 files changed, 27 insertions(+) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..8601be4 --- /dev/null +++ b/.pre-commit-config.yaml @@ -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/ \ No newline at end of file diff --git a/requirements-dev.txt b/requirements-dev.txt index 13502c7..4759ae5 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -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