-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
69 lines (63 loc) · 2.36 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
69 lines (63 loc) · 2.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
repos:
# Secret scanning — blocks commits with leaked credentials
- repo: https://github.com/Yelp/detect-secrets
rev: v1.5.0
hooks:
- id: detect-secrets
args: ['--baseline', '.secrets.baseline']
exclude: '\.secrets\.baseline'
# Git history secret scan
- repo: https://github.com/gitleaks/gitleaks
rev: v8.18.4
hooks:
- id: gitleaks
# Python security linting (medium+ severity only)
- repo: https://github.com/PyCQA/bandit
rev: 1.7.8
hooks:
- id: bandit
args: ["-r", "core/", "fabric/", "-ll", "--skip", "B101"]
# B101 = assert_used — allowed in tests, skip globally
# Semgrep — custom healthcare + platform rules
- repo: https://github.com/returntocorp/semgrep
rev: v1.70.0
hooks:
- id: semgrep
args: ["--config", ".semgrep/", "--error", "--quiet"]
pass_filenames: false
# Standard hygiene
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.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=1000']
- id: detect-private-key
# Python formatting check (ruff + black)
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.4
hooks:
- id: ruff
args: ["--fix"]
- id: ruff-format
# Generated docs must match the code. READ-ONLY (--check): never writes a file,
# only fails the commit telling you to run `python core/scripts/gen_data_dictionary.py`.
# Runs in the project env (venv active locally, or pip-installed deps in CI).
- repo: local
hooks:
- id: data-dictionary-current
name: data dictionary is current (generated)
entry: python core/scripts/gen_data_dictionary.py --check
language: system
pass_filenames: false
files: '^(core/transforms/registry\.py|core/validation/(schema_registry|validate)\.py|core/scripts/gen_data_dictionary\.py|docs/DATA_DICTIONARY\.md)$'
- id: corpus-schema-current
name: corpus JSON Schema is current (generated)
entry: python core/scripts/gen_corpus_schema.py --check
language: system
pass_filenames: false
files: '^(core/gold/encounter_summary\.py|core/scripts/gen_corpus_schema\.py|schemas/gold_encounter_summary\.json)$'