-
Notifications
You must be signed in to change notification settings - Fork 336
/
Copy path.pre-commit-config.yaml
48 lines (48 loc) · 1.62 KB
/
.pre-commit-config.yaml
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
repos:
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: "v0.6.3"
hooks:
- id: ruff-format
- id: ruff
args: [ --fix ]
- repo: local
hooks:
- id: clean-notebooks
name: clean-notebooks
files: \.ipynb$
exclude: ^tutorials/evals/.*\.ipynb$
stages: [ pre-commit ]
language: system
entry: jupyter nbconvert --ClearOutputPreprocessor.enabled=True --ClearMetadataPreprocessor.enabled=True --inplace
- repo: local
hooks:
- id: format-notebooks
name: format-notebooks
files: \.ipynb$
stages: [ pre-commit ]
language: system
entry: nbqa ruff --fix --ignore=E402 --ignore=E501 --ignore=F704
- repo: https://github.com/pre-commit/mirrors-prettier
rev: "6f3cb139ef36133b6f903b97facc57b07cef57c9"
hooks:
- id: prettier
files: \.(jsx?|tsx?|css|.md)$
exclude: \.*__generated__.*$
additional_dependencies:
- repo: https://github.com/pre-commit/mirrors-eslint
rev: "8ddcbd412c0b348841f0f82c837702f432539652"
hooks:
- id: eslint
additional_dependencies:
- repo: local
hooks:
- id: forbid-commit-to-local-main-branch
name: Check branch before committing
entry: bash -c '[[ "$(git rev-parse --abbrev-ref HEAD)" != "main" ]] || { echo "Should not commit to local main branch."; exit 1; }'
language: system
stages: [ pre-commit ]