1a195a96bd
- Merge origin/main into branch (resolve conflict in integrations_dashboard.html) - Add defensive JSON parsing with try/except for integration.config - Wrap tester() call in try/except to prevent 500 errors from bad config - Add i18n key integrations.connection_test_failed_fallback in en.json - Reference i18n key in template JS fallback message - Update SECURITY_AUDIT.md: add fix date (2026-03-23), update doc date - Remove accidental revert.sh file - Fix missing MagicMock/patch imports in test file - Add tests for invalid JSON config and tester exception error paths Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com> Agent-Logs-Url: https://github.com/christianlouis/DocuElevate/sessions/daebb70e-059a-4601-8864-88eef49f99cf
68 lines
1.8 KiB
YAML
68 lines
1.8 KiB
YAML
# Pre-commit hooks for code quality and security
|
|
# Install: pip install pre-commit
|
|
# Setup: pre-commit install
|
|
# Run manually: pre-commit run --all-files
|
|
|
|
repos:
|
|
# General file checks
|
|
- 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-added-large-files
|
|
args: ['--maxkb=1000']
|
|
- id: check-merge-conflict
|
|
- id: detect-private-key
|
|
- id: detect-aws-credentials
|
|
args: ['--allow-missing-credentials']
|
|
|
|
# Ruff - Fast Python linter and formatter (replaces Black, Flake8, isort, Bandit)
|
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
rev: v0.3.0
|
|
hooks:
|
|
- id: ruff
|
|
args: [ --fix ]
|
|
- id: ruff-format
|
|
|
|
# Type checking
|
|
- repo: https://github.com/pre-commit/mirrors-mypy
|
|
rev: v1.8.0
|
|
hooks:
|
|
- id: mypy
|
|
args: ['--ignore-missing-imports']
|
|
additional_dependencies: ['types-requests']
|
|
|
|
# Secret detection
|
|
- repo: https://github.com/Yelp/detect-secrets
|
|
rev: v1.4.0
|
|
hooks:
|
|
- id: detect-secrets
|
|
args: ['--baseline', '.secrets.baseline']
|
|
exclude: |
|
|
(?x)^(
|
|
.+\.lock|
|
|
.+\.json|
|
|
.env.demo
|
|
)$
|
|
|
|
# Alembic migration chain validation
|
|
- repo: local
|
|
hooks:
|
|
- id: check-alembic-migrations
|
|
name: Check Alembic migration chain
|
|
entry: python scripts/check_alembic_migrations.py
|
|
language: python
|
|
pass_filenames: false
|
|
files: ^migrations/versions/.*\.py$
|
|
|
|
# Conventional commits validation
|
|
- repo: https://github.com/compilerla/conventional-pre-commit
|
|
rev: v3.0.0
|
|
hooks:
|
|
- id: conventional-pre-commit
|
|
stages: [commit-msg]
|
|
args: []
|