-
Notifications
You must be signed in to change notification settings - Fork 5
/
.pre-commit-config.yaml
139 lines (124 loc) · 3.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
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
131
132
133
134
135
136
137
138
139
ci:
skip: [flake8, taplo-lint]
repos:
# Formatters
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-ast
- id: check-builtin-literals
- id: check-merge-conflict
- id: end-of-file-fixer
- id: trailing-whitespace
- id: debug-statements
- id: fix-encoding-pragma
args: [--remove]
- repo: https://github.com/PyCQA/docformatter
rev: 06907d0
hooks:
- id: docformatter
additional_dependencies: [tomli]
args: [--in-place, --config, ./pyproject.toml]
- repo: https://github.com/tox-dev/pyproject-fmt
rev: "v2.5.0"
hooks:
- id: pyproject-fmt
- repo: https://github.com/MarcoGorelli/absolufy-imports
rev: v0.3.1
hooks:
- id: absolufy-imports
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v4.0.0-alpha.8 # Use the sha or tag you want to point at
hooks:
- id: prettier
additional_dependencies: ["[email protected]"]
# Notebook tools
- repo: https://github.com/kynan/nbstripout
rev: 0.8.1
hooks:
- id: nbstripout
args: [--drop-empty-cells]
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.8.3
hooks:
- id: ruff
name: "ruff sort imports notebooks"
args:
- "--fix"
- "--select=I"
- "--config=.ruff-notebooks.toml"
alias: isort-notebooks
types_or: [jupyter]
- id: ruff-format
name: "ruff format notebooks"
types_or: [jupyter]
args:
- "--config=.ruff-notebooks.toml"
alias: format-notebooks
- id: ruff
name: "ruff lint notebooks"
types_or: [jupyter]
args:
- "--config=.ruff-notebooks.toml"
alias: check-notebooks
# Linters
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.13.0
hooks:
- id: mypy
exclude: ^docs
additional_dependencies: [types-tabulate, pydantic]
- repo: https://github.com/econchick/interrogate
rev: 1.7.0
hooks:
- id: interrogate
args: [-vv, --config=pyproject.toml, pyglotaran_extras]
pass_filenames: false
additional_dependencies: [click<8]
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.8.3
hooks:
- id: ruff
name: "ruff sort imports"
args:
- "--fix"
- "--select=I"
alias: isort
- id: ruff-format
# Commands above are both formatters an not linters
# See also: https://github.com/astral-sh/ruff/discussions/7310#discussioncomment-7102010
- id: ruff
name: "ruff lint"
- repo: https://github.com/PyCQA/flake8
rev: 7.1.1
hooks:
- id: flake8
alias: flake8-docs
args:
- "--select=DOC"
- "--extend-ignore=DOC502,DOC601,DOC603"
- "--color=always"
- "--require-return-section-when-returning-nothing=False"
- "--allow-init-docstring=True"
- "--skip-checking-short-docstrings=False"
name: "flake8 lint docstrings"
exclude: "^(docs/|tests?/)"
additional_dependencies: [pydoclint==0.5.6]
- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
hooks:
- id: codespell
types: [file]
types_or: [python, pyi, markdown, rst, jupyter]
args: ["--ignore-words-list=doas"]
- repo: https://github.com/rhysd/actionlint
rev: "v1.7.4"
hooks:
- id: actionlint
- repo: https://github.com/ComPWA/taplo-pre-commit
rev: v0.9.3
hooks:
- id: taplo-format
- id: taplo-lint