1
- ---
2
1
ci :
3
- # We rely on renovate to update it but there is no way to fully disable it
4
- # https://github.com/pre-commit-ci/issues/issues/83
5
2
autoupdate_schedule : quarterly
6
3
skip :
7
- - renovate-config-validator # container limits
4
+ - renovate-config-validator
8
5
default_language_version :
9
- # ensures that we get same behavior on CI(s) as on local machines
10
6
python : python3.11
11
- exclude : >
12
- (?x)^(
13
- _readthedocs|
14
- .tox
15
- )$
7
+ exclude : " (?x)^(\n _readthedocs|\n .tox\n )$\n "
16
8
repos :
17
9
- repo : https://github.com/renovatebot/pre-commit-hooks
18
- rev : 41.113.0
10
+ rev : 41.113.6
19
11
hooks :
20
12
- id : renovate-config-validator
21
13
alias : renovate
22
- args : [--strict]
14
+ args :
15
+ - --strict
23
16
- repo : https://github.com/rbubley/mirrors-prettier
24
- rev : " v3.6.2"
17
+ rev : v3.6.2
25
18
hooks :
26
19
- id : prettier
27
- # Original hook implementation is flaky due to *several* bugs described
28
- # in https://github.com/prettier/prettier/issues/12364
29
- # a) CI=1 needed to avoid incomplete output
30
- # b) two executions are needed because --list-different works correctly
31
- # only when run with --check as with --write the output will also
32
- # include other entries and logging level cannot be used to keep only
33
- # modified files listed (any file is listes using the log level, regardless if
34
- # is modified or not).
35
- # c) We avoid letting pre-commit pass each filename in order to avoid
36
- # runing multiple instances in parallel. This also ensures that running
37
- # prettier from the command line behaves identically with the pre-commit
38
- # one. No real performance downsides.
39
- # d) exit with the return code from list-different (0=none, 1=some)
40
- # rather than the write (0=successfully rewrote files). pre-commit.ci
41
- entry : env CI=1 bash -c "prettier --list-different . || ec=$? && prettier --loglevel=error --write . && exit $ec"
20
+ entry :
21
+ env CI=1 bash -c "prettier --list-different . || ec=$? && prettier
22
+ --loglevel=error --write . && exit $ec"
42
23
pass_filenames : false
43
24
args : []
44
25
additional_dependencies :
45
26
- prettier
46
27
- prettier-plugin-toml
47
-
48
28
- repo : https://github.com/pappasam/toml-sort
49
29
rev : v0.24.3
50
30
hooks :
51
31
- id : toml-sort-fix
52
-
53
32
- repo : https://github.com/tox-dev/tox-ini-fmt
54
33
rev : 1.6.0
55
34
hooks :
56
35
- id : tox-ini-fmt
57
-
58
- - repo : https://github.com/astral-sh/ruff-pre-commit
59
- rev : " v0.13.0"
60
- hooks :
61
- - id : ruff
62
- entry : sh -c 'ruff check --fix --force-exclude && ruff format --force-exclude'
63
- types_or : [python, pyi]
64
-
65
36
- repo : https://github.com/streetsidesoftware/cspell-cli
66
37
rev : v9.2.0
67
38
hooks :
68
39
- id : cspell
69
40
name : Spell check with cspell
70
-
71
- - repo : https://github.com/Lucas-C/pre-commit-hooks.git
72
- rev : v1.5.5
73
- hooks :
74
- - id : remove-tabs
75
- exclude : >
76
- (?x)^(
77
- .config/pylint-baseline.txt
78
- )$
79
-
80
41
- repo : https://github.com/pre-commit/pre-commit-hooks.git
81
42
rev : v6.0.0
82
43
hooks :
83
- # Side-effects:
84
44
- id : trailing-whitespace
85
45
- id : check-merge-conflict
86
46
- id : end-of-file-fixer
@@ -90,84 +50,71 @@ repos:
90
50
- id : check-case-conflict
91
51
- id : check-symlinks
92
52
- id : check-yaml
93
- exclude : >
94
- (?x)^
95
- (
96
- mkdocs.yml
97
- )
98
- $
53
+ exclude : " (?x)^\n (\n mkdocs.yml\n )\n $\n "
99
54
- id : detect-private-key
100
- # Heavy checks:
101
55
- id : check-ast
102
56
- id : debug-statements
103
-
104
57
- repo : https://gitlab.com/bmares/check-json5
105
- # Allow json comments, trailing commas
106
- # https://github.com/pre-commit/pre-commit-hooks/issues/395
107
58
rev : v1.0.0
108
59
hooks :
109
60
- id : check-json5
110
-
111
61
- repo : https://github.com/igorshubovych/markdownlint-cli
112
62
rev : v0.45.0
113
63
hooks :
114
64
- id : markdownlint
115
- exclude : >
116
- (?x)^
117
- (
118
- \.github/ISSUE_TEMPLATE/\w+|
119
- docs/(
120
- faq|
121
- index|
122
- )|
123
- README|
124
- src/ansible_navigator/data/(help|welcome)
125
- )\.md
126
- $
127
-
65
+ exclude :
66
+ " (?x)^\n (\n \\ .github/ISSUE_TEMPLATE/\\ w+|\n docs/(\n faq|\n
67
+ \ index|\n )|\n README|\n src/ansible_navigator/data/(help|welcome)\n
68
+ \ )\\ .md\n $\n "
128
69
- repo : https://github.com/codespell-project/codespell
129
70
rev : v2.4.1
130
71
hooks :
131
72
- id : codespell
132
- # NOTE: dout is part of the stdout action regex
133
- args : ["-L", "dout"]
134
- # We exclude generated and external files as they are not directly under
135
- # our control, so we cannot fix spelling in them.
136
- exclude : >
137
- (?x)^
138
- (
139
- tests/fixtures/integration/actions/.*\.json|
140
- src/ansible_navigator/data/grammar/.*\.json
141
- )
142
- $
143
-
73
+ args :
74
+ - -L
75
+ - dout
76
+ exclude :
77
+ " (?x)^\n (\n tests/fixtures/integration/actions/.*\\ .json|\n
78
+ \ src/ansible_navigator/data/grammar/.*\\ .json\n )\n $\n "
144
79
- repo : https://github.com/adrienverge/yamllint.git
145
80
rev : v1.37.1
146
81
hooks :
147
82
- id : yamllint
148
83
args :
149
84
- --strict
150
- types : [file, yaml]
151
-
85
+ types :
86
+ - file
87
+ - yaml
152
88
- repo : https://github.com/PyCQA/flake8.git
153
89
rev : 7.3.0
154
90
hooks :
155
91
- id : flake8
156
92
language_version : python3
157
93
additional_dependencies :
158
- - flake8-docstrings # uses pydocstyle
159
-
94
+ - flake8-docstrings
160
95
- repo : https://github.com/jsh9/pydoclint
161
96
rev : 0.7.3
162
97
hooks :
163
98
- id : pydoclint
164
-
165
99
- repo : https://github.com/asottile/pyupgrade
166
- # keep it after flake8
167
100
rev : v3.20.0
168
101
hooks :
169
102
- id : pyupgrade
170
- args : ["--py310-plus"]
103
+ args :
104
+ - --py310-plus
105
+ - repo : https://github.com/pappasam/toml-sort
106
+ rev : v0.24.2
107
+ hooks :
108
+ - id : toml-sort-fix
109
+ alias : toml
110
+
111
+ - repo : https://github.com/astral-sh/ruff-pre-commit
112
+ rev : v0.13.0
113
+ hooks :
114
+ - id : ruff-format
115
+ alias : ruff
116
+ - id : ruff-check
117
+ alias : ruff
171
118
- repo : https://github.com/pre-commit/mirrors-mypy.git
172
119
rev : v1.18.1
173
120
hooks :
@@ -182,9 +129,8 @@ repos:
182
129
- types-docutils
183
130
- types-mock
184
131
- types-PyYAML
185
- - types-setuptools # Needed logging version
132
+ - types-setuptools
186
133
- types-typed-ast
187
-
188
134
- repo : https://github.com/pycqa/pylint.git
189
135
rev : v3.3.8
190
136
hooks :
@@ -197,7 +143,7 @@ repos:
197
143
- ansible-core
198
144
- ansible-runner
199
145
- astroid
200
- - dill>=0.3.6 # needed for py311
146
+ - dill>=0.3.6
201
147
- jinja2
202
148
- jsonschema
203
149
- libtmux
0 commit comments