forked from GridTools/gt4py
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
124 lines (118 loc) · 3.37 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
# -----------------------------------------------------------------------
# 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/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/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.5.1
##[[[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/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.10.1 =========
##[[[end]]]
rev: v1.10.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, 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==23.2.0
- black==24.4.2
- boltons==24.0.0
- cached-property==1.5.2
- click==8.1.7
- cmake==3.30.0
- cytoolz==0.12.3
- deepdiff==7.0.1
- devtools==0.12.2
- factory-boy==3.3.0
- frozendict==2.4.4
- gridtools-cpp==2.3.4
- importlib-resources==6.4.0
- jinja2==3.1.4
- lark==1.1.9
- mako==1.3.5
- nanobind==2.0.0
- ninja==1.11.1.1
- numpy==1.24.4
- packaging==24.1
- pybind11==2.13.1
- setuptools==70.2.0
- tabulate==0.9.0
- typing-extensions==4.12.2
- 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/.*
)$