-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pre-commit-config.yaml
83 lines (78 loc) · 2.22 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
default_language_version:
python: python3.8
exclude: ^(build|dist|.*\.egg(-info)?|\.github)
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-added-large-files
- id: check-ast
- id: check-case-conflict
- id: trailing-whitespace
exclude: (\.md|\.rst|splash.py)$
- id: end-of-file-fixer
- id: check-yaml
- id: check-merge-conflict
- id: check-symlinks
- id: check-xml
- id: check-executables-have-shebangs
- id: check-shebang-scripts-are-executable
exclude: (\.jinjia2?|\.j2)$
- id: debug-statements
- id: destroyed-symlinks
- id: detect-private-key
exclude: ^(modules)
- id: end-of-file-fixer
- id: fix-byte-order-marker
- id: fix-encoding-pragma
args: [ "--remove" ]
- id: mixed-line-ending
args: [ "--fix=lf" ]
- id: name-tests-test
args: [ "--pytest-test-first" ]
- id: requirements-txt-fixer
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.14
hooks:
- id: ruff-format
- id: ruff
name: ruff-required
args:
- --ignore=FIX,ERA,D,PLR6301,PLR2004,RUF100
- --fix
- --exit-non-zero-on-fix
- id: ruff
name: ruff-optional
verbose: true
args:
- --select=FIX,ERA,D,PLR6301,PLR2004
- --ignore=D105,D107,D203,D205,D212,RUF100
- --no-fix
- --exit-zero
# this one is needed to properly apply noqa removal when all rules are selected, N.B. will exit 0
- id: ruff
name: ruff-cleanups
args:
- --fix
- --silent
- --exit-zero
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.8.0
hooks:
- id: mypy
exclude: ^tests/
args:
- --install-types
- --non-interactive
additional_dependencies:
- numpy
- repo: https://github.com/Lucas-C/pre-commit-hooks-safety
rev: v1.3.2
hooks:
- id: python-safety-dependencies-check
files: requirements.*\.txt
- repo: https://github.com/jorisroovers/gitlint
rev: v0.19.1
hooks:
- id: gitlint
- id: gitlint-ci