Skip to content

Commit 6b542b9

Browse files
authored
Update hooks (#393)
1 parent 5243cba commit 6b542b9

File tree

12 files changed

+199
-149
lines changed

12 files changed

+199
-149
lines changed

.config/constraints.txt

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# This file was autogenerated by uv via the following command:
22
# tox run -e deps
3-
ansible-compat==25.1.4 # via ansible-lint
4-
ansible-lint==25.1.3 # via ansible-creator (pyproject.toml)
5-
argcomplete==3.6.1 # via ansible-creator (pyproject.toml)
3+
ansible-compat==25.1.5 # via ansible-lint
4+
ansible-lint==25.2.1 # via ansible-creator (pyproject.toml)
5+
argcomplete==3.6.2 # via ansible-creator (pyproject.toml)
66
astroid==3.3.9 # via pylint
77
attrs==25.3.0 # via jsonschema, referencing
88
babel==2.17.0 # via mkdocs-material
@@ -19,8 +19,8 @@ cfgv==3.4.0 # via pre-commit
1919
chardet==5.2.0 # via tox
2020
charset-normalizer==3.4.1 # via requests
2121
click==8.1.8 # via black, mkdocs, pydoclint
22-
colorama==0.4.6 # via click, griffe, mkdocs, mkdocs-material, pylint, pytest, tox
23-
coverage==7.7.1 # via ansible-creator (pyproject.toml)
22+
colorama==0.4.6 # via griffe, mkdocs-material, tox
23+
coverage==7.8.0 # via ansible-creator (pyproject.toml)
2424
cryptography==44.0.2 # via ansible-core
2525
csscompressor==0.9.5 # via mkdocs-minify-plugin
2626
cssselect2==0.8.0 # via cairosvg
@@ -32,7 +32,7 @@ docstring-parser-fork==0.0.12 # via pydoclint
3232
execnet==2.1.1 # via pytest-xdist
3333
filelock==3.18.0 # via ansible-lint, tox, virtualenv
3434
ghp-import==2.1.0 # via mkdocs
35-
griffe==1.7.1 # via mkdocstrings-python
35+
griffe==1.7.2 # via mkdocstrings-python
3636
hjson==3.1.0 # via mkdocs-macros-plugin, super-collections
3737
htmlmin2==0.1.13 # via mkdocs-minify-plugin
3838
identify==2.6.9 # via pre-commit
@@ -58,29 +58,32 @@ mkdocs-gen-files==0.5.0 # via mkdocs-ansible
5858
mkdocs-get-deps==0.2.0 # via mkdocs
5959
mkdocs-htmlproofer-plugin==1.3.0 # via mkdocs-ansible
6060
mkdocs-macros-plugin==1.3.7 # via mkdocs-ansible
61-
mkdocs-material==9.6.9 # via mkdocs-ansible
61+
mkdocs-material==9.6.11 # via mkdocs-ansible
6262
mkdocs-material-extensions==1.3.1 # via mkdocs-ansible, mkdocs-material
6363
mkdocs-minify-plugin==0.8.0 # via mkdocs-ansible
6464
mkdocs-monorepo-plugin==1.1.0 # via mkdocs-ansible
65-
mkdocstrings==0.29.0 # via mkdocs-ansible, mkdocstrings-python
66-
mkdocstrings-python==1.16.8 # via mkdocs-ansible
65+
mkdocstrings==0.29.1 # via mkdocs-ansible, mkdocstrings-python
66+
mkdocstrings-python==1.16.10 # via mkdocs-ansible
6767
mypy==1.15.0 # via ansible-creator (pyproject.toml)
6868
mypy-extensions==1.0.0 # via black, mypy
6969
nodeenv==1.9.1 # via pre-commit
70-
packaging==24.2 # via ansible-compat, ansible-core, ansible-lint, black, mkdocs, mkdocs-macros-plugin, pyproject-api, pytest, tox
70+
packaging==24.2 # via ansible-compat, ansible-core, ansible-lint, black, mkdocs, mkdocs-macros-plugin, pyproject-api, pytest, pytest-sugar, tox
7171
paginate==0.5.7 # via mkdocs-material
7272
pathspec==0.12.1 # via ansible-lint, black, mkdocs, mkdocs-macros-plugin, yamllint
7373
pillow==11.1.0 # via cairosvg, mkdocs-ansible
7474
platformdirs==4.3.7 # via black, mkdocs-get-deps, pylint, tox, virtualenv
7575
pluggy==1.5.0 # via pytest, tox
7676
pre-commit==4.2.0 # via ansible-creator (pyproject.toml)
7777
pycparser==2.22 # via cffi
78-
pydoclint==0.6.2 # via ansible-creator (pyproject.toml)
78+
pydoclint==0.6.5 # via ansible-creator (pyproject.toml)
7979
pygments==2.19.1 # via mkdocs-material
8080
pylint==3.3.6 # via ansible-creator (pyproject.toml)
8181
pymdown-extensions==10.14.3 # via markdown-exec, mkdocs-ansible, mkdocs-material, mkdocstrings
8282
pyproject-api==1.9.0 # via tox
83-
pytest==8.3.5 # via pytest-xdist, ansible-creator (pyproject.toml)
83+
pytest==8.3.5 # via pytest-instafail, pytest-plus, pytest-sugar, pytest-xdist, ansible-creator (pyproject.toml)
84+
pytest-instafail==0.5.0 # via ansible-creator (pyproject.toml)
85+
pytest-plus==0.8.1 # via ansible-creator (pyproject.toml)
86+
pytest-sugar==1.0.0 # via ansible-creator (pyproject.toml)
8487
pytest-xdist==3.6.1 # via ansible-creator (pyproject.toml)
8588
python-dateutil==2.9.0.post0 # via ghp-import, mkdocs-macros-plugin
8689
python-slugify==8.0.4 # via mkdocs-monorepo-plugin
@@ -90,20 +93,20 @@ referencing==0.36.2 # via ansible-lint, jsonschema, jsonschema-specificati
9093
requests==2.32.3 # via linkchecker, mkdocs-htmlproofer-plugin, mkdocs-material
9194
rpds-py==0.24.0 # via jsonschema, referencing
9295
ruamel-yaml==0.18.10 # via ansible-lint
93-
ruff==0.11.2 # via ansible-creator (pyproject.toml)
96+
ruff==0.11.3 # via ansible-creator (pyproject.toml)
9497
six==1.17.0 # via python-dateutil
9598
soupsieve==2.6 # via beautifulsoup4
9699
subprocess-tee==0.4.2 # via ansible-compat, ansible-lint
97100
super-collections==0.5.3 # via mkdocs-macros-plugin
98-
termcolor==2.5.0 # via mkdocs-macros-plugin
101+
termcolor==3.0.1 # via mkdocs-macros-plugin, pytest-sugar
99102
text-unidecode==1.3 # via python-slugify
100103
tinycss2==1.4.0 # via cairosvg, cssselect2
101104
toml-sort==0.24.2 # via ansible-creator (pyproject.toml)
102105
tomlkit==0.13.2 # via pylint, toml-sort
103106
tox==4.25.0 # via ansible-creator (pyproject.toml)
104-
types-pyyaml==6.0.12.20250326 # via ansible-creator (pyproject.toml)
107+
types-pyyaml==6.0.12.20250402 # via ansible-creator (pyproject.toml)
105108
urllib3==2.3.0 # via requests
106-
virtualenv==20.29.3 # via pre-commit, tox
109+
virtualenv==20.30.0 # via pre-commit, tox
107110
watchdog==6.0.0 # via mkdocs
108111
wcmatch==10.0 # via ansible-lint
109112
webencodings==0.5.1 # via cssselect2, tinycss2

.config/pydoclint-baseline.txt

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
tests/fixtures/collection/testorg/testcol/tests/integration/test_integration.py
2+
DOC502: Function `test_integration` has a "Raises" section in the docstring, but there are not "raise" statements in the body
3+
--------------------
4+
tests/fixtures/collection/testorg/testcol/tests/unit/test_basic.py
5+
DOC502: Function `test_basic` has a "Raises" section in the docstring, but there are not "raise" statements in the body
6+
--------------------
7+
tests/integration/test_init.py
8+
DOC502: Function `test_run_help` has a "Raises" section in the docstring, but there are not "raise" statements in the body
9+
DOC502: Function `test_run_no_subcommand` has a "Raises" section in the docstring, but there are not "raise" statements in the body
10+
DOC502: Function `test_run_init_no_input` has a "Raises" section in the docstring, but there are not "raise" statements in the body
11+
DOC502: Function `test_run_deprecated_failure` has a "Raises" section in the docstring, but there are not "raise" statements in the body
12+
DOC502: Function `test_run_init_invalid_name` has a "Raises" section in the docstring, but there are not "raise" statements in the body
13+
DOC502: Function `test_run_init_basic` has a "Raises" section in the docstring, but there are not "raise" statements in the body
14+
DOC502: Function `test_run_init_ee` has a "Raises" section in the docstring, but there are not "raise" statements in the body
15+
--------------------
16+
tests/integration/test_lint.py
17+
DOC502: Function `test_lint_collection` has a "Raises" section in the docstring, but there are not "raise" statements in the body
18+
DOC502: Function `test_lint_playbook_project` has a "Raises" section in the docstring, but there are not "raise" statements in the body
19+
--------------------
20+
tests/units/test_add.py
21+
DOC502: Function `test_run_success_add_devfile` has a "Raises" section in the docstring, but there are not "raise" statements in the body
22+
DOC502: Function `test_run_error_no_overwrite` has a "Raises" section in the docstring, but there are not "raise" statements in the body
23+
DOC502: Function `test_error_invalid_path` has a "Raises" section in the docstring, but there are not "raise" statements in the body
24+
DOC502: Function `test_error_invalid_collection_path` has a "Raises" section in the docstring, but there are not "raise" statements in the body
25+
DOC502: Function `test_run_error_unsupported_resource_type` has a "Raises" section in the docstring, but there are not "raise" statements in the body
26+
DOC502: Function `test_run_success_add_devcontainer` has a "Raises" section in the docstring, but there are not "raise" statements in the body
27+
DOC502: Function `test_run_success_add_plugin_filter` has a "Raises" section in the docstring, but there are not "raise" statements in the body
28+
DOC502: Function `test_run_success_add_plugin_lookup` has a "Raises" section in the docstring, but there are not "raise" statements in the body
29+
DOC502: Function `test_run_success_add_plugin_action` has a "Raises" section in the docstring, but there are not "raise" statements in the body
30+
DOC502: Function `test_run_success_add_plugin_module` has a "Raises" section in the docstring, but there are not "raise" statements in the body
31+
DOC502: Function `test_run_success_add_plugin_test` has a "Raises" section in the docstring, but there are not "raise" statements in the body
32+
DOC502: Function `test_run_error_plugin_no_overwrite` has a "Raises" section in the docstring, but there are not "raise" statements in the body
33+
DOC502: Function `test_run_error_unsupported_plugin_type` has a "Raises" section in the docstring, but there are not "raise" statements in the body
34+
DOC502: Function `test_run_success_add_execution_env` has a "Raises" section in the docstring, but there are not "raise" statements in the body
35+
DOC502: Function `test_update_galaxy_dependency` has a "Raises" section in the docstring, but there are not "raise" statements in the body
36+
--------------------
37+
tests/units/test_argparse_help.py
38+
DOC502: Function `test_custom_help_single` has a "Raises" section in the docstring, but there are not "raise" statements in the body
39+
DOC502: Function `test_custom_help_double` has a "Raises" section in the docstring, but there are not "raise" statements in the body
40+
--------------------
41+
tests/units/test_basic.py
42+
DOC502: Function `test_configuration_class` has a "Raises" section in the docstring, but there are not "raise" statements in the body
43+
DOC502: Function `test_cli_parser` has a "Raises" section in the docstring, but there are not "raise" statements in the body
44+
DOC502: Function `test_missing_j2` has a "Raises" section in the docstring, but there are not "raise" statements in the body
45+
DOC502: Function `test_cli_init_output` has a "Raises" section in the docstring, but there are not "raise" statements in the body
46+
DOC502: Function `test_cli_main` has a "Raises" section in the docstring, but there are not "raise" statements in the body
47+
DOC502: Function `test_collection_name_short` has a "Raises" section in the docstring, but there are not "raise" statements in the body
48+
DOC502: Function `test_collection_name_invalid` has a "Raises" section in the docstring, but there are not "raise" statements in the body
49+
DOC502: Function `test_is_a_tty` has a "Raises" section in the docstring, but there are not "raise" statements in the body
50+
DOC502: Function `test_not_a_tty` has a "Raises" section in the docstring, but there are not "raise" statements in the body
51+
DOC502: Function `test_main` has a "Raises" section in the docstring, but there are not "raise" statements in the body
52+
DOC502: Function `test_proj_main` has a "Raises" section in the docstring, but there are not "raise" statements in the body
53+
DOC502: Function `test_coming_soon` has a "Raises" section in the docstring, but there are not "raise" statements in the body
54+
DOC502: Function `test_config_post_init` has a "Raises" section in the docstring, but there are not "raise" statements in the body
55+
--------------------
56+
tests/units/test_compat.py
57+
DOC502: Function `test_import` has a "Raises" section in the docstring, but there are not "raise" statements in the body
58+
--------------------
59+
tests/units/test_init.py
60+
DOC502: Function `test_run_success_for_collection` has a "Raises" section in the docstring, but there are not "raise" statements in the body
61+
DOC502: Function `test_run_success_ee_project` has a "Raises" section in the docstring, but there are not "raise" statements in the body
62+
DOC502: Function `test_run_success_ansible_project` has a "Raises" section in the docstring, but there are not "raise" statements in the body
63+
DOC502: Function `test_run_success_collections_alt_dir` has a "Raises" section in the docstring, but there are not "raise" statements in the body
64+
DOC502: Function `test_delete_error` has a "Raises" section in the docstring, but there are not "raise" statements in the body
65+
DOC502: Function `test_is_file_error` has a "Raises" section in the docstring, but there are not "raise" statements in the body
66+
DOC502: Function `test_name_in_devfile_collection` has a "Raises" section in the docstring, but there are not "raise" statements in the body
67+
DOC502: Function `test_name_in_devfile_playbook` has a "Raises" section in the docstring, but there are not "raise" statements in the body
68+
--------------------
69+
tests/units/test_templar.py
70+
DOC502: Function `test_templar` has a "Raises" section in the docstring, but there are not "raise" statements in the body
71+
DOC502: Function `test_templar_json_simple` has a "Raises" section in the docstring, but there are not "raise" statements in the body
72+
DOC502: Function `test_templar_json_complex` has a "Raises" section in the docstring, but there are not "raise" statements in the body
73+
--------------------
74+
tests/units/test_utils.py
75+
DOC502: Function `test_expand_path` has a "Raises" section in the docstring, but there are not "raise" statements in the body
76+
DOC502: Function `test_skip_dirs` has a "Raises" section in the docstring, but there are not "raise" statements in the body
77+
DOC502: Function `test_overwrite` has a "Raises" section in the docstring, but there are not "raise" statements in the body
78+
DOC502: Function `test_skip_repeats` has a "Raises" section in the docstring, but there are not "raise" statements in the body
79+
DOC502: Function `test_ask_yes_no_yes` has a "Raises" section in the docstring, but there are not "raise" statements in the body
80+
DOC502: Function `test_ask_yes_no_no` has a "Raises" section in the docstring, but there are not "raise" statements in the body
81+
DOC502: Function `test_ask_yes_no_invalid_then_yes` has a "Raises" section in the docstring, but there are not "raise" statements in the body
82+
DOC502: Function `test_ask_yes_no_invalid_then_no` has a "Raises" section in the docstring, but there are not "raise" statements in the body
83+
--------------------

.config/requirements-test.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ pydoclint
77
pylint
88
pytest
99
pytest-xdist
10+
pytest-sugar
11+
pytest-instafail
12+
pytest-plus
1013
ruff
1114
toml-sort
1215
tox

.pre-commit-config.yaml

Lines changed: 29 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ ci:
1111
# No docker on pre-commit.ci
1212

1313
repos:
14+
- repo: meta
15+
hooks:
16+
- id: check-useless-excludes
1417
- repo: https://github.com/rbubley/mirrors-prettier
1518
# keep it before yamllint
1619
rev: v3.5.3
@@ -20,6 +23,11 @@ repos:
2023
additional_dependencies:
2124
- prettier
2225
26+
- repo: https://github.com/streetsidesoftware/cspell-cli
27+
rev: v8.17.3
28+
hooks:
29+
- id: cspell
30+
name: Spell check with cspell
2331
- repo: https://github.com/pre-commit/pre-commit-hooks
2432
rev: v5.0.0
2533
hooks:
@@ -54,59 +62,45 @@ repos:
5462
rev: v0.24.2
5563
hooks:
5664
- id: toml-sort-fix
65+
alias: toml
5766

5867
- repo: https://github.com/tox-dev/tox-ini-fmt
5968
rev: 1.5.0
6069
hooks:
6170
- id: tox-ini-fmt
6271

6372
- repo: https://github.com/astral-sh/ruff-pre-commit
64-
rev: v0.9.9
73+
rev: v0.11.3
6574
hooks:
6675
- id: ruff
67-
args:
68-
- --fix
69-
- --exit-non-zero-on-fix
70-
types_or: [python, pyi]
71-
- id: ruff-format # must be after ruff
72-
types_or: [python, pyi]
73-
74-
- repo: https://github.com/streetsidesoftware/cspell-cli
75-
rev: v8.17.3
76+
entry: sh -c 'ruff check --fix --force-exclude && ruff format --force-exclude'
77+
- repo: https://github.com/pre-commit/mirrors-mypy.git
78+
rev: v1.15.0
7679
hooks:
77-
- id: cspell
78-
name: Spell check with cspell
79-
80+
- id: mypy
81+
additional_dependencies: &deps
82+
- argcomplete
83+
- jinja2
84+
- pytest
85+
- pyyaml
86+
- types-pyyaml
87+
# Override default pre-commit '--ignore-missing-imports'
88+
args: []
8089
- repo: https://github.com/jsh9/pydoclint
81-
rev: "0.6.2"
90+
rev: "0.6.5"
8291
hooks:
8392
- id: pydoclint
8493
# This allows automatic reduction of the baseline file when needed.
8594
entry: sh -ec "pydoclint . && pydoclint --generate-baseline=1 ."
8695
pass_filenames: false
8796

8897
- repo: https://github.com/pycqa/pylint.git
89-
rev: v3.3.4
98+
rev: v3.3.6
9099
hooks:
91100
- id: pylint
92101
args:
93102
- --output-format=colorized
94-
additional_dependencies:
95-
- jinja2
96-
- pytest
97-
- pyyaml
98-
99-
- repo: https://github.com/pre-commit/mirrors-mypy.git
100-
rev: v1.15.0
101-
hooks:
102-
- id: mypy
103-
additional_dependencies:
104-
- argcomplete
105-
- jinja2
106-
- pytest
107-
- types-pyyaml
108-
# Override default pre-commit '--ignore-missing-imports'
109-
args: [--strict]
103+
additional_dependencies: *deps
110104

111105
# Keep last due to being considerably slower than the others:
112106
- repo: local
@@ -117,22 +111,20 @@ repos:
117111
files: ^(pyproject\.toml|\.config/.*)$
118112
always_run: true
119113
language: python
120-
language_version: "3.10" # minimal we support officially https://github.com/astral-sh/uv/issues/3883
121-
entry: python3 -m uv pip compile -q --all-extras --universal --output-file=.config/constraints.txt pyproject.toml --upgrade
114+
entry: python3 -m uv pip compile -q --all-extras --python-version=3.10 --output-file=.config/constraints.txt pyproject.toml --upgrade
122115
pass_filenames: false
123116
stages:
124117
- manual
125118
additional_dependencies:
126-
- uv>=0.5.25
119+
- uv>=0.6.6
127120
- id: lock
128121
name: Check constraints files and requirements
129122
files: ^(pyproject\.toml|\.config/.*)$
130123
language: python
131-
language_version: "3.10" # minimal we support officially https://github.com/astral-sh/uv/issues/3883
132-
entry: python3 -m uv pip compile -q --all-extras --universal --output-file=.config/constraints.txt pyproject.toml
124+
entry: uv pip compile -q --all-extras --python-version=3.10 --output-file=.config/constraints.txt pyproject.toml
133125
pass_filenames: false
134126
additional_dependencies:
135-
- uv>=0.5.25
127+
- uv>=0.6.6
136128
- repo: https://github.com/mashi/codecov-validator
137129
rev: "1.0.1"
138130
hooks:

.python-version

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
3.10
2+
3+
# Needed by dependabot, see https://github.com/dependabot/dependabot-core/issues/1455

.taplo.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[formatting]
2+
# cspell: disable-next-line
3+
# compatibility between toml-sort-fix pre-commit hook and panekj.even-betterer-toml extension
4+
align_comments = false
5+
array_trailing_comma = false
6+
compact_arrays = true
7+
compact_entries = false
8+
compact_inline_tables = true
9+
inline_table_expand = false
10+
reorder_keys = true

.vscode/extensions.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@
88
"ms-python.mypy-type-checker",
99
"ms-python.pylint",
1010
"ms-python.python",
11-
"sonarsource.sonarlint-vscode",
12-
"streetsidesoftware.code-spell-checker"
11+
"redhat.ansible",
12+
"redhat.vscode-yaml",
13+
"streetsidesoftware.code-spell-checker",
14+
"tamasfe.even-better-toml",
15+
"timonwong.shellcheck"
1316
]
1417
}

ansible.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# User during testing to ensure local user config does not affect testing

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ select = ["ALL"]
348348
parametrize-values-type = "tuple"
349349

350350
[tool.ruff.lint.isort]
351-
known-first-party = ["ansible_creator"]
351+
known-first-party = ["src"]
352352
lines-after-imports = 2 # Ensures consistency for cases when there's variable vs function/class definitions after imports
353353
lines-between-types = 1 # Separate import/from with 1 line
354354
required-imports = ["from __future__ import annotations"]

src/ansible_creator/types.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# noqa: A005
21
"""A home for shared types."""
32

43
from __future__ import annotations

0 commit comments

Comments
 (0)