Skip to content

Commit a3fc7e4

Browse files
pre-commit-ci[bot]cristianonicolaiaudgirka
authored
chore: pre-commit autoupdate (#4010)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Cristiano Nicolai <570894+cristianonicolai@users.noreply.github.com> Co-authored-by: Ajinkya Udgirkar <ajinkyaudgirkar@gmail.com>
1 parent 4b36ffa commit a3fc7e4

File tree

8 files changed

+12
-11
lines changed

8 files changed

+12
-11
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ repos:
7676
args: [--relative, --no-progress, --no-summary]
7777
name: Spell check with cspell
7878
- repo: https://github.com/python-jsonschema/check-jsonschema
79-
rev: 0.27.3
79+
rev: 0.27.4
8080
hooks:
8181
- id: check-github-workflows
8282
- repo: https://github.com/pre-commit/pre-commit-hooks.git
@@ -136,7 +136,7 @@ repos:
136136
types: [file, yaml]
137137
entry: yamllint --strict
138138
- repo: https://github.com/astral-sh/ruff-pre-commit
139-
rev: "v0.1.13"
139+
rev: "v0.2.0"
140140
hooks:
141141
- id: ruff
142142
args: [--fix, --exit-non-zero-on-fix]

src/ansiblelint/formatters/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ class BaseFormatter(Generic[T]):
2929
----
3030
base_dir (str|Path): reference directory against which display relative path.
3131
display_relative_path (bool): whether to show path as relative or absolute
32+
3233
"""
3334

3435
def __init__(self, base_dir: str | Path, display_relative_path: bool) -> None:

src/ansiblelint/rules/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def create_matcherror(
9393
match_type: str | None = None
9494
while not match_type and frame is not None:
9595
func_name = frame.f_code.co_name
96-
match_type = match_types.get(func_name, None)
96+
match_type = match_types.get(func_name)
9797
if match_type:
9898
# add the match_type to the match
9999
match.match_type = match_type
@@ -558,7 +558,7 @@ def list_tags(self) -> str:
558558
tags[tag] = list(rule.ids())
559559
result = "# List of tags and rules they cover\n"
560560
for tag in sorted(tags):
561-
desc = tag_desc.get(tag, None)
561+
desc = tag_desc.get(tag)
562562
if desc:
563563
result += f"{tag}: # {desc}\n"
564564
else:

src/ansiblelint/rules/galaxy.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ def matchplay(self, file: Lintable, data: dict[str, Any]) -> list[MatchError]:
6464
for path in changelog_paths:
6565
if path.is_file():
6666
changelog_found = 1
67-
galaxy_tag_list = data.get("tags", None)
68-
collection_deps = data.get("dependencies", None)
67+
galaxy_tag_list = data.get("tags")
68+
collection_deps = data.get("dependencies")
6969
if collection_deps:
7070
for dep, ver in collection_deps.items():
7171
if (

src/ansiblelint/rules/no_prompting.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def matchplay(self, file: Lintable, data: dict[str, Any]) -> list[MatchError]:
3434
if file.kind != "playbook": # pragma: no cover
3535
return []
3636

37-
vars_prompt = data.get("vars_prompt", None)
37+
vars_prompt = data.get("vars_prompt")
3838
if not vars_prompt:
3939
return []
4040
return [

src/ansiblelint/rules/run_once.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def matchplay(self, file: Lintable, data: dict[str, Any]) -> list[MatchError]:
3535
if not file or file.kind != "playbook" or not data:
3636
return []
3737

38-
strategy = data.get("strategy", None)
38+
strategy = data.get("strategy")
3939
run_once = data.get("run_once", False)
4040
if (not strategy and not run_once) or strategy != "free":
4141
return []

src/ansiblelint/skip_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ def get_nested_tasks(task: Any) -> Generator[Any, None, None]:
240240
if not task or not is_nested_task(task):
241241
return
242242
for k in NESTED_TASK_KEYS:
243-
if k in task and task[k]:
243+
if task.get(k):
244244
if hasattr(task[k], "get"):
245245
continue
246246
for subtask in task[k]:

src/ansiblelint/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
import logging
2929
import os
3030
import re
31-
from collections.abc import Generator, ItemsView, Iterator, Mapping, Sequence
31+
from collections.abc import ItemsView, Iterator, Mapping, Sequence
3232
from dataclasses import _MISSING_TYPE, dataclass, field
3333
from functools import cache, lru_cache
3434
from pathlib import Path
@@ -774,7 +774,7 @@ def __getitem__(self, index: str) -> Any:
774774
"""Allow access as task[...]."""
775775
return self.normalized_task[index]
776776

777-
def __iter__(self) -> Generator[str, None, None]:
777+
def __iter__(self) -> Iterator[str]:
778778
"""Provide support for 'key in task'."""
779779
yield from (f for f in self.normalized_task)
780780

0 commit comments

Comments
 (0)