829682d07c
Feature/DAIP2-2112 implement pre commit hooks * Add pre-commit hooks for local code quality checks Adds .pre-commit-config.yaml with file hygiene hooks (trailing-whitespace, end-of-file-fixer, check-yaml/json, check-merge-conflict, check-added-large-files) plus local hooks for black and mypy on pre-commit and pytest on pre-push. Includes setup documentation and adds pre-commit to dev dependencies. Auto-fixed trailing whitespace and missing newlines caught by the new hooks. * Add sample pre-commit hook for testing purposes * Add test file for pre-commit hook validation * Remove test file for pre-commit hook validation * Merged DEV into feature/DAIP2-2112-implement-pre-commit-hooks--- * Merged DEV into feature/DAIP2-2112-implement-pre-commit-hooks--- * Move to documentation Approved-by: Katon Minhas
40 lines
925 B
YAML
40 lines
925 B
YAML
default_language_version:
|
|
python: python3.12
|
|
|
|
default_install_hook_types: [pre-commit, pre-push]
|
|
|
|
repos:
|
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
rev: v4.5.0
|
|
hooks:
|
|
- id: trailing-whitespace
|
|
- id: end-of-file-fixer
|
|
- id: check-yaml
|
|
- id: check-json
|
|
- id: check-merge-conflict
|
|
- id: check-added-large-files
|
|
args: ['--maxkb=500']
|
|
|
|
- repo: local
|
|
hooks:
|
|
- id: black
|
|
name: black (formatter)
|
|
entry: uv run black src/
|
|
language: system
|
|
pass_filenames: false
|
|
types: [python]
|
|
|
|
- id: mypy
|
|
name: mypy (type check)
|
|
entry: uv run mypy src/
|
|
language: system
|
|
pass_filenames: false
|
|
types: [python]
|
|
|
|
- id: pytest
|
|
name: pytest (unit tests)
|
|
entry: uv run pytest src/tests/
|
|
language: system
|
|
pass_filenames: false
|
|
stages: [pre-push]
|