forked from teemtee/tmt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pre-commit-config.yaml
114 lines (104 loc) · 4.22 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
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/hhatto/autopep8
rev: 'v2.0.4'
hooks:
- id: autopep8
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: "v4.5.0"
hooks:
- id: end-of-file-fixer
- id: mixed-line-ending
- id: trailing-whitespace
- id: check-toml
- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v1.6.1"
hooks:
- id: mypy
# TODO: find out how to amend mypy, pyright, pre-commit and package requirements.
# Apparently, there is no easy way to avoid some level of duplication of
# information when the package is *not* installed, which is the case of tmt
# & pre-commit in our setup.
#
# For now, we simply copy & paste from pyproject.toml :(
additional_dependencies:
- "click>=8.0.3,!=8.1.4" # 8.1.3 / 8.1.6 TODO type annotations tmt.cli.Context -> click.core.Context click/issues/2558
- "fmf>=1.3.0"
- "jinja2>=2.11.3" # 3.1.2 / 3.1.2
- "pint>=0.16.1,<0.20" # 0.16.1 / 0.19.x TODO: Pint 0.20 requires larger changes to tmt.hardware
- "requests>=2.25.1" # 2.28.2 / 2.31.0
- "ruamel.yaml>=0.16.6" # 0.17.32 / 0.17.32
- "urllib3>=1.26.5, <2.0" # 1.26.16 / 2.0.4
- "typing-extensions>=4.4.0; python_version < '3.10'" # TypeAlias introduced in 3.10, Self in 3.11
- "pytest"
- "requre"
# Do not install *types-click* - it's not recommended with Click 8 & newer,
# which is the version a developer encounters given the requirements are not
# frozen.
- "types-Markdown"
- "types-requests"
- "types-setuptools"
- "types-jsonschema"
- "types-urllib3"
- "types-jinja2"
- "types-babel"
pass_filenames: false
args: [--config-file=pyproject.toml]
- repo: https://github.com/RobertCraigie/pyright-python
rev: v1.1.334
hooks:
- id: pyright
# TODO: find out how to amend mypy, pyright, pre-commit and package requirements.
# Apparently, there is no easy way to avoid some level of duplication of
# information when the package is *not* installed, which is the case of tmt
# & pre-commit in our setup.
#
# For now, we simply copy & paste from pyproject.toml :(
additional_dependencies:
- "click>=8.0.3,!=8.1.4" # 8.1.3 / 8.1.6 TODO type annotations tmt.cli.Context -> click.core.Context click/issues/2558
- "fmf>=1.3.0"
- "jinja2>=2.11.3" # 3.1.2 / 3.1.2
- "pint>=0.16.1,<0.20" # 0.16.1 / 0.19.x TODO: Pint 0.20 requires larger changes to tmt.hardware
- "requests>=2.25.1" # 2.28.2 / 2.31.0
- "ruamel.yaml>=0.16.6" # 0.17.32 / 0.17.32
- "urllib3>=1.26.5, <2.0" # 1.26.16 / 2.0.4
- "typing-extensions>=4.4.0; python_version < '3.10'" # TypeAlias introduced in 3.10, Self in 3.11
- "pytest"
- "requre"
# Do not install *types-click* - it's not recommended with Click 8 & newer,
# which is the version a developer encounters given the requirements are not
# frozen.
- "types-Markdown"
- "types-requests"
- "types-setuptools"
- "types-jsonschema"
- "types-urllib3"
- "types-jinja2"
- "types-babel"
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: "0.27.0"
hooks:
- id: check-metaschema
name: "Check JSON schemas validity"
files: ^tmt/schemas/.*\.yaml
- repo: https://github.com/adrienverge/yamllint
rev: v1.32.0
hooks:
- id: yamllint
files: ^tmt/schemas/.*\.yaml
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.1.1
hooks:
- id: ruff
args:
- '--fix'
- '--show-fixes'
- repo: https://github.com/teemtee/tmt.git
rev: 1.28.2
hooks:
- id: tmt-lint
additional_dependencies:
# Make sure we use fmf compatible with tmt in the repo, not the 1.26.0 version.
- "fmf>=1.3.0"
- "pint<0.20"