2026-05-09 17:48:22 +02:00
|
|
|
# Pre-commit hooks configuration for NexQuant
|
2026-04-03 11:56:27 +02:00
|
|
|
# See https://pre-commit.com for more information
|
|
|
|
|
|
|
|
|
|
repos:
|
2026-05-03 21:20:41 +02:00
|
|
|
# ── Test Coverage Check: new modules must have tests ──────────────
|
|
|
|
|
- repo: local
|
|
|
|
|
hooks:
|
|
|
|
|
- id: check-test-coverage
|
|
|
|
|
name: Check new rdagent modules have tests
|
|
|
|
|
entry: python scripts/check_test_coverage.py
|
|
|
|
|
language: system
|
|
|
|
|
pass_filenames: false
|
|
|
|
|
always_run: true
|
|
|
|
|
|
|
|
|
|
# ── MyPy Ratchet: no new type errors allowed ────────────────────
|
|
|
|
|
- repo: local
|
|
|
|
|
hooks:
|
|
|
|
|
- id: mypy-ratchet
|
|
|
|
|
name: MyPy ratchet (no new type errors)
|
|
|
|
|
entry: python scripts/check_mypy_ratchet.py
|
|
|
|
|
language: system
|
|
|
|
|
pass_filenames: false
|
|
|
|
|
always_run: true
|
|
|
|
|
|
2026-05-03 11:05:39 +02:00
|
|
|
# ── Qlib Unit Tests (MANDATORY) ──────────────────────────────────
|
2026-04-03 12:33:30 +02:00
|
|
|
- repo: local
|
|
|
|
|
hooks:
|
2026-05-03 11:05:39 +02:00
|
|
|
- id: qlib-unit-tests
|
2026-05-03 14:00:49 +02:00
|
|
|
name: Qlib Unit Tests (~490 tests)
|
2026-04-03 12:33:30 +02:00
|
|
|
entry: pytest
|
|
|
|
|
language: system
|
|
|
|
|
args:
|
2026-05-03 11:05:39 +02:00
|
|
|
- test/qlib/
|
|
|
|
|
- test/backtesting/
|
2026-04-03 12:33:30 +02:00
|
|
|
- -v
|
|
|
|
|
- --tb=short
|
2026-05-03 21:20:41 +02:00
|
|
|
- --cov=rdagent
|
|
|
|
|
- --cov-fail-under=33
|
|
|
|
|
- --cov-report=term
|
2026-05-03 11:05:39 +02:00
|
|
|
- --ignore=test/backtesting/test_ftmo_oos.py
|
|
|
|
|
- --ignore=test/backtesting/test_kronos_adapter.py
|
|
|
|
|
- --ignore=test/qlib/test_fin_quant_integration.py
|
2026-04-03 12:33:30 +02:00
|
|
|
pass_filenames: false
|
|
|
|
|
always_run: true
|
|
|
|
|
|
|
|
|
|
# ── Security Scanning (MANDATORY) ─────────────────────────────────
|
2026-04-03 11:56:27 +02:00
|
|
|
- repo: local
|
|
|
|
|
hooks:
|
|
|
|
|
- id: bandit-security-scan
|
|
|
|
|
name: Bandit Security Scan
|
|
|
|
|
entry: bandit
|
|
|
|
|
language: system
|
|
|
|
|
args:
|
|
|
|
|
- -r
|
|
|
|
|
- rdagent/
|
|
|
|
|
- -c
|
|
|
|
|
- .bandit.yml
|
|
|
|
|
- --severity-level=medium
|
|
|
|
|
- --confidence-level=medium
|
|
|
|
|
- --format=txt
|
|
|
|
|
pass_filenames: false
|
|
|
|
|
always_run: true
|