forked from braindecode/braindecode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
108 lines (102 loc) · 3.24 KB
/
.pre-commit-config.yaml
File metadata and controls
108 lines (102 loc) · 3.24 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
default_language_version:
python: python3
ci:
autofix_commit_msg: |
[pre-commit.ci] auto fixes from pre-commit.com hooks
autofix_prs: true
autoupdate_branch: "master"
autoupdate_commit_msg: "[pre-commit.ci] pre-commit autoupdate"
autoupdate_schedule: quarterly
skip: [ ]
submodules: false
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: check-yaml
- id: check-json
- id: check-executables-have-shebangs
- id: check-toml
- id: check-docstring-first
- id: check-added-large-files
# accepting until 2 mb
args: ['--maxkb=2048']
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-case-conflict
- id: mixed-line-ending
- id: forbid-new-submodules
- id: pretty-format-json
args: [ "--autofix", "--no-sort-keys", "--indent=4" ]
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.12.9
hooks:
- id: ruff-format
name: ruff format code
files: ^(braindecode|docs|examples)/
- id: ruff
name: ruff lint docs & examples
args:
[
"--fix",
"--select=E,W,F,I,D", # E=errors, W=warnings, F=pyflakes, I=import sorting, D=docstring rules
"--ignore=E402,E501,F401,D103,D400,D100,D101,D102,D105,D107,D415,D417,D205", # combined ignores
]
files: ^(docs|examples)/
- id: ruff
name: ruff — remove unused imports
args:
- --fix
- --select=F401,I
- --exit-non-zero-on-fix
types: [python]
- id: ruff
name: ruff lint braindecode preview
args:
[
"--fix",
"--preview",
"--select=NPY201",
"--ignore=D100,D101,D102,D105,D107,D415,D417,D205",
]
files: ^braindecode/
- id: ruff
name: ruff lint docs & examples
args:
[
"--fix",
"--select=D", # docstring rules
"--ignore=D103,D400,E402,D100,D101,D102,D105,D107,D415,D417,D205", # drop these specific checks
]
files: ^(docs|examples)/
- repo: https://github.com/codespell-project/codespell
rev: v2.4.1
hooks:
- id: codespell
args:
- --ignore-words-list=Gool,carin,splitted,meaned,wil,whats,additionals,alle,alot,bund,currenty,datas,farenheit,falsy,fo,haa,hass,iif,incomfort,ines,ist,nam,nd,pres,pullrequests,resset,rime,ser,serie,te,technik,ue,unsecure,withing,zar,mane,THIRDPARTY
- --skip="./.*,*.csv,*.json,*.ambr,*.toml"
- --quiet-level=2
exclude_types: [ csv, json ]
exclude: ^tests/|generated/^.github
- repo: https://github.com/asottile/blacken-docs
rev: 1.19.1
hooks:
- id: blacken-docs
exclude: ^.github|CONTRIBUTING.md
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.17.1
hooks:
- id: mypy
files: braindecode/.*.py|test/.*.py|examples/.*.py
additional_dependencies:
[
types-PyYAML,
types-requests,
]
verbose: true
- repo: https://github.com/PyCQA/isort
rev: 6.0.1
hooks:
- id: isort
exclude: ^\.gitignore