forked from GridTools/gt4py
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
132 lines (125 loc) · 3.5 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
# -----------------------------------------------------------------------
# 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]
exclude: tox.ini
- id: pretty-format-toml
args: [--autofix]
exclude: tach.toml
- 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.5.5
hooks:
- id: insert-license
exclude: ^\..*$
types: [python]
args: [--comment-style, "|#|", --license-filepath, ./HEADER.txt, --fuzzy-match-generates-todo]
- 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
- repo: https://github.com/astral-sh/ruff-pre-commit
##[[[cog
## import re
## version = re.search('ruff==([0-9\.]*)', open("constraints.txt").read())[1]
## print(f"rev: v{version}")
##]]]
rev: v0.8.2
##[[[end]]]
hooks:
# Run the linter.
# TODO: include tests here
- id: ruff
files: ^src/
args: [--fix]
# Run the formatter.
- id: ruff-format
- repo: https://github.com/gauge-sh/tach-pre-commit
rev: v0.10.7
hooks:
- id: tach
- 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.13.0 =========
##[[[end]]]
rev: v1.13.0 # 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, sys
## if sys.version_info >= (3, 11):
## import tomllib
## else:
## import tomli as tomllib
## constraints = open("constraints.txt").read()
## project = tomllib.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==24.2.0
- black==24.8.0
- boltons==24.1.0
- cached-property==2.0.1
- click==8.1.7
- cmake==3.31.1
- cytoolz==1.0.0
- deepdiff==8.0.1
- devtools==0.12.2
- diskcache==5.6.3
- factory-boy==3.3.1
- filelock==3.16.1
- frozendict==2.4.6
- gridtools-cpp==2.3.8
- importlib-resources==6.4.5
- jinja2==3.1.4
- lark==1.2.2
- mako==1.3.8
- nanobind==2.4.0
- ninja==1.11.1.2
- numpy==1.24.4
- packaging==24.2
- pybind11==2.13.6
- setuptools==75.3.0
- tabulate==0.9.0
- typing-extensions==4.12.2
- xxhash==3.0.0
##[[[end]]]
- types-tabulate
- types-typed-ast
args: [--no-install-types]
exclude: |
(?x)^(
setup.py |
build/.* |
ci/.* |
docs/.* |
tests/.*
)$