forked from thclark/pre-commit-sphinx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pre-commit-config.yaml
173 lines (173 loc) · 5.25 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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
# See https://pre-commit.com/ for documentation
# For installation:
# - install via
# pip install pre-commit
# - activate via
# pre-commit install
# Now the below hooks will run at any invocation of
# git commit
# To check all files in the repositoy run
# pre-commit run --all-files
repos:
- repo: meta # this repo checks pre-commit itself
hooks:
- id: check-hooks-apply # configured hooks apply to at least one file
- id: check-useless-excludes # ensures exclude directives apply to at least one file
- repo: https://gitlab.com/vojko.pribudic.foss/pre-commit-update
rev: v0.6.1
hooks:
- id: pre-commit-update
args: [--dry-run]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-added-large-files
- id: check-ast
- id: check-builtin-literals
- id: check-case-conflict
- id: check-executables-have-shebangs
# - id: check-json
- id: check-merge-conflict
- id: check-shebang-scripts-are-executable
- id: check-toml
# - id: check-xml
- id: check-yaml
- id: debug-statements
- id: end-of-file-fixer
- id: mixed-line-ending
- id: no-commit-to-branch
# - id: pretty-format-json
# args: ["--autofix"]
- id: requirements-txt-fixer
# - id: sort-simple-yaml
- id: trailing-whitespace
types: [text]
# - repo: https://github.com/koalaman/shellcheck-precommit
# rev: v0.10.0
# hooks:
# - id: shellcheck
# # args: ["--severity=warning"] # Optionally only show errors and warnings
- repo: https://github.com/codespell-project/codespell
rev: v2.4.1
hooks:
- id: codespell
# - repo: https://github.com/rstcheck/rstcheck
# rev: v6.2.4
# hooks:
# - id: rstcheck
# args: ["--ignore-directives", "uml"]
# additional_dependencies: ["rstcheck[sphinx]", "sphinxcontrib-plantuml"]
# exclude: docs/_templates/
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0
hooks:
- id: python-check-blanket-noqa
- id: python-check-blanket-type-ignore
- id: python-check-mock-methods
- id: python-no-eval
- id: python-no-log-warn
- id: python-use-type-annotations
# - id: rst-backticks
# - id: rst-directive-colons
# - id: rst-inline-touching-normal
- id: text-unicode-replacement-char
# - repo: https://github.com/thclark/pre-commit-sphinx
# rev: 0.0.3
# hooks:
# - id: build-docs
# args: ['--html-dir', 'docs/_build/html', '--source-dir', 'docs/']
# language_version: python3
# additional_dependencies: [sphinx, sphinx-autoapi, furo]
- repo: https://github.com/hhatto/autopep8
rev: v2.3.2
hooks:
- id: autopep8
- repo: https://github.com/PyCQA/bandit
rev: 1.8.2
hooks:
- id: bandit
args: ["-c", "pyproject.toml"]
additional_dependencies: ["bandit[toml]"]
- repo: https://github.com/asottile/pyupgrade
rev: v3.19.1
hooks:
- id: pyupgrade
args: ["--py313-plus"]
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 25.1.0
hooks:
- id: black
# It is recommended to specify the latest version of Python
# supported by your project here, or alternatively use
# pre-commit's default_language_version, see
# https://pre-commit.com/#top_level-default_language_version
language_version: python3.13
- repo: local
hooks:
- id: isort
name: isort
entry: isort
language: system
types: [python]
args: ["--settings=pyproject.toml", "--line-length=120", "--profile=black", "--force-grid-wrap=2",
"--multi-line=3"]
- id: flake8
name: flake8
entry: flake8
language: system
types: [python]
# E265 block comment should start with '# '
# E266 too many leading '#' for block comment
# W503 line break before binary operator
args: ["--config=setup.cfg", "--ignore=E265,E266,W503,", "--max-line-length=120",
"--exclude=.git,__pycache__", "--select=C,E,F,W,B,B9"]
- id: pycodestyle
name: pycodestyle
entry: pycodestyle
language: system
types: [python]
# E203 whitespace before ‘,’, ‘;’, or ‘:’ - falsely triggers on list slices
# E265 block comment should start with '# '
# E266 too many leading '#' for block comment
# W503 line break before binary operator
args: ["--config=setup.cfg", "--ignore=E203,E265,E266,W503,", "--max-line-length=120",
"--exclude=.git,__pycache__"]
- id: pydocstyle
name: pydocstyle
entry: pydocstyle
language: system
types: [python]
args: ["--config=pyproject.toml", "--convention=numpy"]
- id: sphinx-lint
name: sphinx-lint
entry: sphinx-lint
language: system
- id: pylint
name: pylint
entry: pylint
language: system
types: [python]
# C0302 too many lines
# C0325 superfluous-parens
# R0801 duplicate-code
# R0912 too-many-branches
# R0913 too-many-arguments
# R0914 too-many-locals
# R0915 too-many-statements
# W0511 fixme
args: ["-rn", "-sn", "--rcfile=pylintrc", "--disable=C0302,C0325,R0801,R0912,R0913,R0914,R0915,W0511,",
"--max-line-length=120", "--ignore=.git,__pycache__"]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.15.0
hooks:
- id: mypy
args: ["--config-file=pyproject.toml"]
language_version: python3
- repo: https://github.com/RobertCraigie/pyright-python
rev: v1.1.393
hooks:
- id: pyright
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.9.5
hooks:
- id: ruff