-
Notifications
You must be signed in to change notification settings - Fork 129
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
78 lines (78 loc) · 3.41 KB
/
.pre-commit-config.yaml
File metadata and controls
78 lines (78 loc) · 3.41 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
70
71
72
73
74
75
76
77
78
repos:
- repo: local
hooks:
- id: license-header-check
name: Run license-check script
entry: ./ci/scripts/license_check.py
language: python
types_or: [python, rust]
pass_filenames: true
always_run: false
- repo: local
hooks:
- id: check-copied-files
name: Run check-copied-files script
entry: ./ci/scripts/check_copied_files.py
language: python
pass_filenames: true
always_run: false
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-yaml
exclude: "mkdocs.yml"
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.12.8
hooks:
- id: ruff
# 1. Attempt to automatically fix any lint issues.
args: ["--fix"]
# Exclude check_copied_files destinations; they are verbatim copies
# of source files and must not be reformatted independently.
exclude: |
(?x)^(
bionemo-recipes/recipes/esm2_native_te/example_8m_checkpoint/esm_nv\.py|
bionemo-recipes/recipes/esm2_peft_te/example_8m_checkpoint/esm_nv\.py|
bionemo-recipes/recipes/esm2_accelerate_te/example_8m_checkpoint/esm_nv\.py|
bionemo-recipes/recipes/vllm_inference/esm2/(modeling_esm_te|convert|export|state)\.py|
bionemo-recipes/recipes/(esm2_native_te|llama3_native_te|esm2_peft_te)/collator\.py|
bionemo-recipes/recipes/llama3_native_te/modeling_llama_te\.py|
bionemo-recipes/models/(llama3|mixtral)/collator\.py|
bionemo-recipes/models/(amplify/src/amplify|llama3|mixtral)/state\.py|
bionemo-recipes/models/(llama3|mixtral)/tests/common/
)$
- id: ruff-format
exclude: |
(?x)^(
bionemo-recipes/recipes/esm2_native_te/example_8m_checkpoint/esm_nv\.py|
bionemo-recipes/recipes/esm2_peft_te/example_8m_checkpoint/esm_nv\.py|
bionemo-recipes/recipes/esm2_accelerate_te/example_8m_checkpoint/esm_nv\.py|
bionemo-recipes/recipes/vllm_inference/esm2/(modeling_esm_te|convert|export|state)\.py|
bionemo-recipes/recipes/(esm2_native_te|llama3_native_te|esm2_peft_te)/collator\.py|
bionemo-recipes/recipes/llama3_native_te/modeling_llama_te\.py|
bionemo-recipes/models/(llama3|mixtral)/collator\.py|
bionemo-recipes/models/(amplify/src/amplify|llama3|mixtral)/state\.py|
bionemo-recipes/models/(llama3|mixtral)/tests/common/
)$
- repo: https://github.com/executablebooks/mdformat
rev: 0.7.22 # Use the latest stable version
hooks:
- id: mdformat
additional_dependencies:
- mdformat-tables
- mdformat-gfm
- mdformat-black
- mdformat-frontmatter
- black==25.12.0
- repo: https://github.com/Yelp/detect-secrets
rev: v1.5.0
hooks:
- id: detect-secrets
name: detect-secrets (everything but notebooks)
args: ['--baseline', '.secrets.baseline', '--exclude-files', '(.*\.ipynb|.*\.baseline)$', ]
exclude: package.lock.json
- id: detect-secrets
name: detect-secrets (notebooks only)
args: ['--baseline', '.secrets-nb.baseline', '--exclude-files', '^.(?!.*\.ipynb)', '--exclude-lines', '"(hash|id|image/\w+)":.*|<.*at 0x[0-9a-f]+>|object at 0x[0-9a-f]+', ]