forked from GridTools/gt4py
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
209 lines (199 loc) · 6.82 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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
# This file contains 'cog' snippets (https://nedbatchelder.com/code/cog/)
# to keep version numbers in sync with 'constraints.txt'
default_language_version:
python: python3.10
repos:
# - repo: meta
# hooks:
# - id: check-hooks-apply
# - id: check-useless-excludes
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: v2.6.0
hooks:
- id: pretty-format-ini
args: [--autofix]
- id: pretty-format-toml
args: [--autofix]
- id: pretty-format-yaml
args: [--autofix, --preserve-quotes, --indent, "2"]
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.0-alpha.4
hooks:
- id: prettier
types_or: [markdown, json]
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.1.9
hooks:
- id: insert-license
exclude: ^\..*$
types: [python]
args: [--comment-style, "|#|", --license-filepath, ./LICENSE_HEADER.txt, --fuzzy-match-generates-todo]
# - repo: https://github.com/asottile/yesqa
# rev: v1.4.0
# hooks:
# - id: yesqa
# additional_dependencies:
# - flake8==5.0.4 # version from constraints.txt
# - darglint
# - flake8-bugbear
# - flake8-builtins
# - flake8-debugger
# - flake8-docstrings
# - flake8-eradicate
# - flake8-mutable
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-case-conflict
- id: check-merge-conflict
- id: check-toml
- id: check-yaml
- id: debug-statements
- repo: https://github.com/psf/black
##[[[cog
## import re
## version = re.search('black==([0-9\.]*)', open("constraints.txt").read())[1]
## print(f"rev: '{version}' # version from constraints.txt")
##]]]
rev: '23.9.1' # version from constraints.txt
##[[[end]]]
hooks:
- id: black
- repo: https://github.com/PyCQA/isort
##[[[cog
## import re
## version = re.search('isort==([0-9\.]*)', open("constraints.txt").read())[1]
## print(f"rev: '{version}' # version from constraints.txt")
##]]]
rev: '5.12.0' # version from constraints.txt
##[[[end]]]
hooks:
- id: isort
- repo: https://github.com/PyCQA/flake8
##[[[cog
## import re
## version = re.search('flake8==([0-9\.]*)', open("constraints.txt").read())[1]
## print(f"rev: '{version}' # version from constraints.txt")
##]]]
rev: '6.1.0' # version from constraints.txt
##[[[end]]]
hooks:
- id: flake8
additional_dependencies:
##[[[cog
## import re
## constraints = open("constraints.txt").read()
## for pkg in ["darglint", "flake8-bugbear", "flake8-builtins", "flake8-debugger", "flake8-docstrings",
## "flake8-eradicate", "flake8-mutable", "flake8-pyproject", "pygments"]:
## print(f"- {pkg}==" + str(re.search(f'\n{pkg}==([0-9\.]*)', constraints)[1]))
##]]]
- darglint==1.8.1
- flake8-bugbear==23.9.16
- flake8-builtins==2.1.0
- flake8-debugger==4.1.2
- flake8-docstrings==1.7.0
- flake8-eradicate==1.5.0
- flake8-mutable==1.2.0
- flake8-pyproject==1.2.3
- pygments==2.16.1
##[[[end]]]
# - flake8-rst-docstrings # Disabled for now due to random false positives
exclude: |
(?x)^(
setup.py |
docs/user/cartesian/conf.py |
src/gt4py/cartesian/__gtscript__.py |
src/gt4py/cartesian/__init__.py |
src/gt4py/cartesian/gtscript.py |
src/gt4py/cartesian/backend/__init__.py |
src/gt4py/cartesian/backend/pyext_builder.py |
src/gt4py/cartesian/frontend/__init__.py |
src/gt4py/cartesian/frontend/nodes.py |
src/gt4py/cartesian/frontend/node_util.py |
src/gt4py/cartesian/utils/__init__.py |
src/gt4py/cartesian/utils/base.py |
src/gt4py/cartesian/utils/attrib.py |
src/gt4py/cartesian/utils/meta.py |
src/gt4py/eve/extended_typing.py |
tests/conftest.py |
tests/cartesian_tests/integration_tests/multi_feature_tests/stencil_definitions.py |
tests/cartesian_tests/integration_tests/multi_feature_tests/test_code_generation.py |
tests/cartesian_tests/integration_tests/multi_feature_tests/utils.py |
tests/cartesian_tests/integration_tests/feature_tests/test_call_interface.py |
tests/cartesian_tests/unit_tests/frontend_tests/test_gtscript_frontend.py |
tests/next_tests/unit_tests/.* |
tests/next_tests/integration_tests/multi_feature_tests/.* |
tests/next_tests/integration_tests/feature_tests/ffront_tests/.* |
tests/next_tests/integration_tests/feature_tests/iterator_tests/.* |
tests/next_tests/integration_tests/feature_tests/otf_tests/.* |
tests/next_tests/integration_tests/feature_tests/math_builtin_test_data.py |
tests/next_tests/past_common_fixtures.py |
tests/next_tests/toy_connectivity.py |
)$
- repo: https://github.com/pre-commit/mirrors-mypy
##[[[cog
## import re
## version = re.search('mypy==([0-9\.]*)', open("constraints.txt").read())[1]
## print(f"#========= FROM constraints.txt: v{version} =========")
##]]]
#========= FROM constraints.txt: v1.5.1 =========
##[[[end]]]
rev: v1.5.1 # MUST match version ^^^^ in constraints.txt (if the mirror is up-to-date)
hooks:
- id: mypy
additional_dependencies: # versions from constraints.txt
##[[[cog
## import re, tomli
## constraints = open("constraints.txt").read()
## project = tomli.loads(open("pyproject.toml").read())
## packages = [re.match('^([\w-][\w\d-]*)', r)[1] for r in project["project"]["dependencies"] if r.strip()]
## for pkg in packages:
## print(f"- {pkg}==" + str(re.search(f'\n{pkg}==([0-9\.]*)', constraints)[1]))
##]]]
- astunparse==1.6.3
- attrs==23.1.0
- black==23.9.1
- boltons==23.0.0
- cached-property==1.5.2
- click==8.1.7
- cmake==3.27.5
- cytoolz==0.12.2
- deepdiff==6.5.0
- devtools==0.12.2
- frozendict==2.3.8
- gridtools-cpp==2.3.1
- importlib-resources==6.0.1
- jinja2==3.1.2
- lark==1.1.7
- mako==1.2.4
- nanobind==1.5.2
- ninja==1.11.1
- numpy==1.24.4
- packaging==23.1
- pybind11==2.11.1
- setuptools==68.2.2
- tabulate==0.9.0
- typing-extensions==4.5.0
- xxhash==3.0.0
##[[[end]]]
# Add all type stubs from typeshed
- types-all
args: [--no-install-types]
exclude: |
(?x)^(
setup.py |
build/.* |
ci/.* |
docs/.* |
tests/conftest.py |
tests/cartesian_tests/.* |
tests/next_tests/unit_tests/.* |
tests/next_tests/integration_tests/multi_feature_tests/.* |
tests/next_tests/integration_tests/feature_tests/ffront_tests/.* |
tests/next_tests/integration_tests/feature_tests/iterator_tests/.* |
tests/next_tests/integration_tests/feature_tests/otf_tests/.* |
tests/next_tests/integration_tests/feature_tests/math_builtin_test_data.py |
tests/next_tests/past_common_fixtures.py |
tests/next_tests/toy_connectivity.py |
tests/.*
)$