-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
130 lines (119 loc) · 3.61 KB
/
.pre-commit-config.yaml
File metadata and controls
130 lines (119 loc) · 3.61 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
default_stages: [pre-commit]
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: debug-statements # Check for debugger imports
- id: requirements-txt-fixer # Order requirements alphabetically
- id: check-ast # Simply check whether the files parse as valid python
- id: check-case-conflict # Check for files that would conflict in case-insensitive filesystems
- id: check-builtin-literals # Require literal syntax when initializing empty or zero Python builtin types
- id: check-docstring-first # Check a common error of defining a docstring after code
- id: check-merge-conflict # Check for files that contain merge conflict strings
- id: check-yaml # Check yaml files
args: ["--unsafe"]
- id: end-of-file-fixer # Ensure that a file is either empty, or ends with one newline
exclude: |
(?x)(
^docs/|
^notebooks/|
)
- id: mixed-line-ending # Replace or checks mixed line ending
exclude: |
(?x)(
^docs/|
^notebooks/|
)
- id: trailing-whitespace # This hook trims trailing whitespace
exclude: |
(?x)(
^docs/|
^notebooks/|
)
- repo: https://github.com/compilerla/conventional-pre-commit
rev: v4.2.0
hooks:
- id: conventional-pre-commit
stages:
- commit-msg
args:
[
"ci",
"build",
"docs",
"feat",
"fix",
"perf",
"refactor",
"style",
"test",
"exp",
"chore",
]
# - repo: https://github.com/asottile/pyupgrade
# rev: v3.15.0
# hooks:
# - id: pyupgrade
# args:
# - --py38-plus
- repo: https://github.com/pycqa/pydocstyle
rev: 6.3.0
hooks:
- id: pydocstyle
additional_dependencies: ["toml"]
args:
- --convention=google
- --add-ignore=D100,D104,D105,D107,D417
- repo: https://github.com/codespell-project/codespell
rev: v2.4.1
hooks:
- id: codespell
name: codespell
description: Checks for common misspellings in text files.
entry: codespell --toml pyproject.toml
language: python
types: [text]
additional_dependencies:
- tomli
exclude: |
^(docs/.venv|dist|build)/
- repo: https://github.com/kynan/nbstripout
rev: 0.8.1
hooks:
- id: nbstripout
exclude: ^notebooks/introducing_the_next_generation_of_InstaNovo_models\.ipynb$
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.13.0
hooks:
# Run the linter.
- id: ruff
args:
[
"--select",
"A,B,C,D,E,F,G,I,N,T,W",
"--fix",
"--ignore",
"B008,C901,D100,D103,D104,D105,D107,D417,F722,G004,N812",
]
types_or: [python, pyi]
# Run the formatter.
- id: ruff-format
types_or: [python, pyi]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v1.17.1"
hooks:
- id: mypy
additional_dependencies: [types-requests, types-PyYAML, types-tqdm] # TODO: pandas-stubs
args:
[
--ignore-missing-imports,
"--exclude=(notebooks|tests)",
--disable-error-code,
"name-defined",
]
- repo: https://github.com/astral-sh/uv-pre-commit
# uv version.
rev: 0.8.17
hooks:
# Update the uv lockfile
- id: uv-lock