Skip to content

Commit

Permalink
chore: pre-commit autoupdate (#3647)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Sorin Sbarnea <[email protected]>
  • Loading branch information
pre-commit-ci[bot] and ssbarnea authored Aug 9, 2023
1 parent ac5a807 commit fdf030f
Show file tree
Hide file tree
Showing 7 changed files with 66 additions and 11 deletions.
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ repos:
- id: check-useless-excludes
- repo: https://github.com/pre-commit/mirrors-prettier
# keep it before yamllint
rev: v3.0.0
rev: v3.0.1
hooks:
- id: prettier
# Temporary excludes so we can gradually normalize the formatting
Expand Down Expand Up @@ -63,7 +63,7 @@ repos:
- prettier-plugin-toml
- prettier-plugin-sort-json
- repo: https://github.com/streetsidesoftware/cspell-cli
rev: v6.31.0
rev: v6.31.1
hooks:
- id: cspell
# entry: codespell --relative
Expand Down Expand Up @@ -129,8 +129,8 @@ repos:
files: \.(yaml|yml)$
types: [file, yaml]
entry: yamllint --strict
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: "v0.0.278"
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.0.282"
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
Expand Down Expand Up @@ -192,7 +192,7 @@ repos:
- wcmatch
- yamllint
- repo: https://github.com/jazzband/pip-tools
rev: 7.0.0
rev: 7.2.0
hooks:
- id: pip-compile
name: lock
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ python_files = [
xfail_strict = true

[tool.ruff]
required-version = "0.0.278"
required-version = "0.0.282"
ignore = [
"E501", # we use black
"ERA001", # auto-removal of commented out code affects development and vscode integration
Expand Down
2 changes: 1 addition & 1 deletion src/ansiblelint/rules/jinja.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def matchtask(
if isinstance(v, str):
try:
template(
basedir=file.path.parent if file else Path("."),
basedir=file.path.parent if file else Path(),
value=v,
variables=deannotate(task.get("vars", {})),
fail_on_error=True, # we later decide which ones to ignore or not
Expand Down
2 changes: 1 addition & 1 deletion src/ansiblelint/rules/yaml_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def _fetch_skips(data: Any, collector: dict[int, set[str]]) -> dict[int, set[str
collector[data.get(LINE_NUMBER_KEY)].update(rules)
if isinstance(data, Iterable) and not isinstance(data, str):
if isinstance(data, dict):
for _entry, value in data.items():
for value in data.values():
_fetch_skips(value, collector)
else: # must be some kind of list
for entry in data:
Expand Down
2 changes: 1 addition & 1 deletion src/ansiblelint/schemas/__store__.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"url": "https://raw.githubusercontent.com/ansible/ansible-lint/main/src/ansiblelint/schemas/role-arg-spec.json"
},
"rulebook": {
"etag": "46da76e7c2ef7065f7e5fe0cff34a9e7beeda9403310b23dbd400b2916a741b6",
"etag": "402beee94a1dfc2bf8b3d04b8d86af13293db2f7e1b8ce3da90d50f1e96b29f4",
"url": "https://raw.githubusercontent.com/ansible/ansible-rulebook/main/ansible_rulebook/schema/ruleset_schema.json"
},
"tasks": {
Expand Down
55 changes: 55 additions & 0 deletions src/ansiblelint/schemas/rulebook.json
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@
{
"$ref": "#/$defs/run-job-template-action"
},
{
"$ref": "#/$defs/run-workflow-template-action"
},
{
"$ref": "#/$defs/post-event-action"
},
Expand Down Expand Up @@ -208,6 +211,9 @@
{
"$ref": "#/$defs/run-job-template-action"
},
{
"$ref": "#/$defs/run-workflow-template-action"
},
{
"$ref": "#/$defs/post-event-action"
},
Expand Down Expand Up @@ -445,6 +451,55 @@
],
"additionalProperties": false
},
"run-workflow-template-action": {
"type": "object",
"properties": {
"run_workflow_template": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"organization": {
"type": "string"
},
"job_args": {
"type": "object"
},
"post_events": {
"type": "boolean"
},
"set_facts": {
"type": "boolean"
},
"ruleset": {
"type": "string"
},
"var_root": {
"type": "string"
},
"retry": {
"type": "boolean"
},
"retries": {
"type": "integer"
},
"delay": {
"type": "integer"
}
},
"required": [
"name",
"organization"
],
"additionalProperties": false
}
},
"required": [
"run_workflow_template"
],
"additionalProperties": false
},
"post-event-action": {
"type": "object",
"properties": {
Expand Down
4 changes: 2 additions & 2 deletions test/test_formatter_sarif.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def test_sarif_file(file: str, return_code: int) -> None:
result = subprocess.run([*cmd, file], check=False, capture_output=True)
assert result.returncode == return_code
assert os.path.exists(output_file.name) # noqa: PTH110
assert os.path.getsize(output_file.name) > 0
assert pathlib.Path(output_file.name).stat().st_size > 0


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

0 comments on commit fdf030f

Please sign in to comment.