forked from Rockachopa/Timmy-time-dashboard
72 lines
1.7 KiB
YAML
72 lines
1.7 KiB
YAML
|
|
# Pre-commit hooks for local development
|
||
|
|
# Install: pip install pre-commit
|
||
|
|
# Setup: pre-commit install
|
||
|
|
# Run manually: pre-commit run --all-files
|
||
|
|
|
||
|
|
repos:
|
||
|
|
# Code formatting
|
||
|
|
- repo: https://github.com/psf/black
|
||
|
|
rev: 23.12.1
|
||
|
|
hooks:
|
||
|
|
- id: black
|
||
|
|
language_version: python3.11
|
||
|
|
args: [--line-length=100]
|
||
|
|
|
||
|
|
# Import sorting
|
||
|
|
- repo: https://github.com/PyCQA/isort
|
||
|
|
rev: 5.13.2
|
||
|
|
hooks:
|
||
|
|
- id: isort
|
||
|
|
args: [--profile=black, --line-length=100]
|
||
|
|
|
||
|
|
# Type checking (optional - can be slow)
|
||
|
|
- repo: https://github.com/pre-commit/mirrors-mypy
|
||
|
|
rev: v1.7.1
|
||
|
|
hooks:
|
||
|
|
- id: mypy
|
||
|
|
additional_dependencies: [types-all]
|
||
|
|
args: [--ignore-missing-imports, --no-error-summary]
|
||
|
|
exclude: ^tests/
|
||
|
|
stages: [manual]
|
||
|
|
|
||
|
|
# YAML validation
|
||
|
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||
|
|
rev: v4.5.0
|
||
|
|
hooks:
|
||
|
|
- id: check-yaml
|
||
|
|
- id: check-json
|
||
|
|
- id: check-toml
|
||
|
|
- id: trailing-whitespace
|
||
|
|
- id: end-of-file-fixer
|
||
|
|
- id: check-merge-conflict
|
||
|
|
- id: debug-statements
|
||
|
|
- id: mixed-line-ending
|
||
|
|
|
||
|
|
# Security checks (optional)
|
||
|
|
- repo: https://github.com/PyCQA/bandit
|
||
|
|
rev: 1.7.5
|
||
|
|
hooks:
|
||
|
|
- id: bandit
|
||
|
|
args: [-ll, --skip, B101,B601]
|
||
|
|
exclude: ^tests/
|
||
|
|
stages: [manual]
|
||
|
|
|
||
|
|
# Fast unit tests only (not E2E, not slow tests)
|
||
|
|
- repo: local
|
||
|
|
hooks:
|
||
|
|
- id: pytest-unit
|
||
|
|
name: pytest-unit
|
||
|
|
entry: pytest
|
||
|
|
language: system
|
||
|
|
types: [python]
|
||
|
|
stages: [commit]
|
||
|
|
pass_filenames: false
|
||
|
|
always_run: true
|
||
|
|
args:
|
||
|
|
- tests
|
||
|
|
- -m
|
||
|
|
- "unit"
|
||
|
|
- --tb=short
|
||
|
|
- -q
|
||
|
|
verbose: true
|