-
Notifications
You must be signed in to change notification settings - Fork 30
/
.pre-commit-config.yaml
69 lines (64 loc) · 2.11 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
- id: detect-private-key
- repo: https://github.com/PyCQA/docformatter
rev: v1.7.5
hooks:
- id: docformatter
args: [--in-place, --black, --wrap-summaries=0, --wrap-descriptions=0]
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.2
hooks:
- id: pyupgrade
args: [--py38-plus]
- repo: https://github.com/srstevenson/nb-clean
rev: 3.2.0
hooks:
- id: nb-clean
args:
- --preserve-cell-outputs
- --preserve-cell-metadata
- tags
- --
- repo: local
hooks:
- id: clean-notebook-metadata
name: Clean notebook metadata
language: python
entry: jupyter nbconvert --ClearMetadataPreprocessor.enabled=True --ClearMetadataPreprocessor.preserve_cell_metadata_mask tags --inplace
files: .*\.ipynb$
stages: [commit, merge-commit]
always_run: false
pass_filenames: true
additional_dependencies: [nbconvert]
- id: notebook-markdown-tutorials
name: Checks for notebook and markdown tutorials
language: python
entry: python -m docs.utils notebook_tutorials_commit_hook
files: recipes\/.*\.ipynb$|docs\/sdk\/tutorials\/.*\.md$
stages: [commit, merge-commit]
always_run: false
pass_filenames: true
require_serial: true
additional_dependencies: [click, nbconvert]
- id: detect-kili-api-key
name: Detect Kili API key
language: python
entry: python .github/scripts/detect_api_key.py
stages: [commit, merge-commit]
always_run: false
pass_filenames: true
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.15
hooks:
- id: ruff
types_or: [python, pyi, jupyter]
args:
- --fix-only # TODO: set this to "--fix" when all manual fixes are done
- --exit-non-zero-on-fix
- id: ruff-format
types_or: [python, pyi, jupyter]