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:
26
.pre-commit-config.yaml
Normal file
26
.pre-commit-config.yaml
Normal 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/
|
||||
Reference in New Issue
Block a user