Skip to content

Commit fdf030f

Browse files
chore: pre-commit autoupdate (#3647)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Sorin Sbarnea <[email protected]>
1 parent ac5a807 commit fdf030f

File tree

7 files changed

+66
-11
lines changed

7 files changed

+66
-11
lines changed

.pre-commit-config.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ repos:
3434
- id: check-useless-excludes
3535
- repo: https://github.com/pre-commit/mirrors-prettier
3636
# keep it before yamllint
37-
rev: v3.0.0
37+
rev: v3.0.1
3838
hooks:
3939
- id: prettier
4040
# Temporary excludes so we can gradually normalize the formatting
@@ -63,7 +63,7 @@ repos:
6363
- prettier-plugin-toml
6464
- prettier-plugin-sort-json
6565
- repo: https://github.com/streetsidesoftware/cspell-cli
66-
rev: v6.31.0
66+
rev: v6.31.1
6767
hooks:
6868
- id: cspell
6969
# entry: codespell --relative
@@ -129,8 +129,8 @@ repos:
129129
files: \.(yaml|yml)$
130130
types: [file, yaml]
131131
entry: yamllint --strict
132-
- repo: https://github.com/charliermarsh/ruff-pre-commit
133-
rev: "v0.0.278"
132+
- repo: https://github.com/astral-sh/ruff-pre-commit
133+
rev: "v0.0.282"
134134
hooks:
135135
- id: ruff
136136
args: [--fix, --exit-non-zero-on-fix]
@@ -192,7 +192,7 @@ repos:
192192
- wcmatch
193193
- yamllint
194194
- repo: https://github.com/jazzband/pip-tools
195-
rev: 7.0.0
195+
rev: 7.2.0
196196
hooks:
197197
- id: pip-compile
198198
name: lock

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ python_files = [
223223
xfail_strict = true
224224

225225
[tool.ruff]
226-
required-version = "0.0.278"
226+
required-version = "0.0.282"
227227
ignore = [
228228
"E501", # we use black
229229
"ERA001", # auto-removal of commented out code affects development and vscode integration

src/ansiblelint/rules/jinja.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def matchtask(
9494
if isinstance(v, str):
9595
try:
9696
template(
97-
basedir=file.path.parent if file else Path("."),
97+
basedir=file.path.parent if file else Path(),
9898
value=v,
9999
variables=deannotate(task.get("vars", {})),
100100
fail_on_error=True, # we later decide which ones to ignore or not

src/ansiblelint/rules/yaml_rule.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def _fetch_skips(data: Any, collector: dict[int, set[str]]) -> dict[int, set[str
107107
collector[data.get(LINE_NUMBER_KEY)].update(rules)
108108
if isinstance(data, Iterable) and not isinstance(data, str):
109109
if isinstance(data, dict):
110-
for _entry, value in data.items():
110+
for value in data.values():
111111
_fetch_skips(value, collector)
112112
else: # must be some kind of list
113113
for entry in data:

src/ansiblelint/schemas/__store__.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"url": "https://raw.githubusercontent.com/ansible/ansible-lint/main/src/ansiblelint/schemas/role-arg-spec.json"
4949
},
5050
"rulebook": {
51-
"etag": "46da76e7c2ef7065f7e5fe0cff34a9e7beeda9403310b23dbd400b2916a741b6",
51+
"etag": "402beee94a1dfc2bf8b3d04b8d86af13293db2f7e1b8ce3da90d50f1e96b29f4",
5252
"url": "https://raw.githubusercontent.com/ansible/ansible-rulebook/main/ansible_rulebook/schema/ruleset_schema.json"
5353
},
5454
"tasks": {

src/ansiblelint/schemas/rulebook.json

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,9 @@
173173
{
174174
"$ref": "#/$defs/run-job-template-action"
175175
},
176+
{
177+
"$ref": "#/$defs/run-workflow-template-action"
178+
},
176179
{
177180
"$ref": "#/$defs/post-event-action"
178181
},
@@ -208,6 +211,9 @@
208211
{
209212
"$ref": "#/$defs/run-job-template-action"
210213
},
214+
{
215+
"$ref": "#/$defs/run-workflow-template-action"
216+
},
211217
{
212218
"$ref": "#/$defs/post-event-action"
213219
},
@@ -445,6 +451,55 @@
445451
],
446452
"additionalProperties": false
447453
},
454+
"run-workflow-template-action": {
455+
"type": "object",
456+
"properties": {
457+
"run_workflow_template": {
458+
"type": "object",
459+
"properties": {
460+
"name": {
461+
"type": "string"
462+
},
463+
"organization": {
464+
"type": "string"
465+
},
466+
"job_args": {
467+
"type": "object"
468+
},
469+
"post_events": {
470+
"type": "boolean"
471+
},
472+
"set_facts": {
473+
"type": "boolean"
474+
},
475+
"ruleset": {
476+
"type": "string"
477+
},
478+
"var_root": {
479+
"type": "string"
480+
},
481+
"retry": {
482+
"type": "boolean"
483+
},
484+
"retries": {
485+
"type": "integer"
486+
},
487+
"delay": {
488+
"type": "integer"
489+
}
490+
},
491+
"required": [
492+
"name",
493+
"organization"
494+
],
495+
"additionalProperties": false
496+
}
497+
},
498+
"required": [
499+
"run_workflow_template"
500+
],
501+
"additionalProperties": false
502+
},
448503
"post-event-action": {
449504
"type": "object",
450505
"properties": {

test/test_formatter_sarif.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ def test_sarif_file(file: str, return_code: int) -> None:
168168
result = subprocess.run([*cmd, file], check=False, capture_output=True)
169169
assert result.returncode == return_code
170170
assert os.path.exists(output_file.name) # noqa: PTH110
171-
assert os.path.getsize(output_file.name) > 0
171+
assert pathlib.Path(output_file.name).stat().st_size > 0
172172

173173

174174
@pytest.mark.parametrize(
@@ -188,5 +188,5 @@ def test_sarif_file_creates_it_if_none_exists(file: str, return_code: int) -> No
188188
result = subprocess.run([*cmd, file], check=False, capture_output=True)
189189
assert result.returncode == return_code
190190
assert os.path.exists(sarif_file_name) # noqa: PTH110
191-
assert os.path.getsize(sarif_file_name) > 0
191+
assert pathlib.Path(sarif_file_name).stat().st_size > 0
192192
pathlib.Path.unlink(pathlib.Path(sarif_file_name))

0 commit comments

Comments
 (0)