Skip to content

Commit 86bedb7

Browse files
ssbarneacognifloyd
andauthored
Address unused-variable pylint rule (#1863)
Co-authored-by: Jacob Floyd <[email protected]>
1 parent 7225d61 commit 86bedb7

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

.pylintrc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,3 @@ disable =
2929
too-many-instance-attributes,
3030
too-many-return-statements,
3131
unused-argument,
32-
unused-variable,

src/ansiblelint/rules/MetaVideoLinksRule.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def matchplay(
6868
)
6969
continue
7070

71-
for name, expr in self.VIDEO_REGEXP.items():
71+
for _, expr in self.VIDEO_REGEXP.items():
7272
if expr.match(video["url"]):
7373
break
7474
else:

src/ansiblelint/rules/VariableHasSpacesRule.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class VariableHasSpacesRule(AnsibleLintRule):
2525
def matchtask(
2626
self, task: Dict[str, Any], file: Optional[Lintable] = None
2727
) -> Union[bool, str]:
28-
for k, v, _ in nested_items_path(task):
28+
for _, v, _ in nested_items_path(task):
2929
if isinstance(v, str):
3030
cleaned = self.exclude_json_re.sub("", v)
3131
if bool(self.bracket_regex.search(cleaned)):

src/ansiblelint/skip_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ def _get_rule_skips_from_yaml(yaml_input: Sequence[Any]) -> Sequence[Any]:
182182
def traverse_yaml(obj: Any) -> None:
183183
yaml_comment_obj_strs.append(str(obj.ca.items))
184184
if isinstance(obj, dict):
185-
for key, val in obj.items():
185+
for _, val in obj.items():
186186
if isinstance(val, (dict, list)):
187187
traverse_yaml(val)
188188
elif isinstance(obj, list):

src/ansiblelint/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,7 @@ def _include_children(
344344
v = v["file"]
345345

346346
# handle include: filename.yml tags=blah
347+
# pylint: disable=unused-variable
347348
(command, args, kwargs) = tokenize("{0}: {1}".format(k, v))
348349

349350
result = path_dwim(basedir, args[0])
@@ -519,7 +520,7 @@ def _look_for_role_files(
519520

520521
for kind in ["tasks", "meta", "handlers", "vars", "defaults"]:
521522
current_path = os.path.join(role_path, kind)
522-
for folder, subdirs, files in os.walk(current_path):
523+
for folder, _, files in os.walk(current_path):
523524
for file in files:
524525
file_ignorecase = file.lower()
525526
if file_ignorecase.endswith((".yml", ".yaml")):

0 commit comments

Comments
 (0)