Files
college-infos/.pre-commit-config.yaml
Antoine Van Elstraete e0cd073f9a test(M4): tests unitaires iCal, client pronotepy et repli
- test_ical.py : 20 tests (fetch file://, parsing VEVENT, détection
  cours annulé, collect_homeworks avec déduplication, normalisation,
  génération d'ID déterministe, redaction des erreurs)
- test_pronote_client.py : 9 tests (Protocol, messages mockés,
  informations, agenda fallback, credentials manquants, sécurité
  mot de passe)
- test_fallback.py : 16 tests (modes ICAL/PRONOTEPY/AUTO, repli,
  PipelineCriticalError si les deux sources échouent, redaction
  des erreurs)
- pre-commit : ajout de responses et pytest-mock au hook mypy
- Total : 42 nouveaux tests M4 (122 tests au total sur le projet)

Co-authored-by: opencode/test-engineer <test-engineer@agents.invalid>
2026-09-06 14:10:16 +02:00

61 lines
1.8 KiB
YAML

# Hooks pre-commit pour pronote-sync
# Installation : pre-commit install
# Exécution manuelle : pre-commit run --all-files
default_language_version:
python: python3
repos:
# Outils du venv (ruff, mypy, bandit) — exécutés dans l'environnement géré par pre-commit
- repo: local
hooks:
- id: ruff-check
name: ruff check
entry: ruff check
language: python
additional_dependencies: ["ruff>=0.4.0"]
types: [python]
- id: ruff-format
name: ruff format
entry: ruff format
language: python
additional_dependencies: ["ruff>=0.4.0"]
types: [python]
- id: mypy
name: mypy
entry: mypy
language: python
additional_dependencies: ["mypy>=1.10.0", "pydantic>=2.0.0", "pydantic-settings>=2.0.0", "pytest>=8.0.0", "types-requests>=2.31.0", "icalendar>=5.0.0", "pronotepy>=2.15.0", "responses>=0.25.0", "pytest-mock>=3.10.0"]
types: [python]
pass_filenames: true
- id: bandit
name: bandit
entry: bandit
args: [-c, pyproject.toml, -r]
language: python
additional_dependencies: ["bandit>=1.7.0"]
types: [python]
# Hooks standard de pre-commit
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
exclude: 'GUIDE_DEV_PYTHON\.md'
- id: end-of-file-fixer
exclude: 'GUIDE_DEV_PYTHON\.md'
- id: check-yaml
- id: check-added-large-files
args: [--maxkb=500]
exclude: 'GUIDE_DEV_PYTHON\.md'
- id: check-merge-conflict
# Détection de secrets
- repo: https://github.com/Yelp/detect-secrets
rev: v1.5.0
hooks:
- id: detect-secrets
args: [--baseline, .secrets.baseline]