fix(scripts): name the unused tuple members instead of using _
ansible-test sanity's pylint disallows _ as a name (18 findings in the bot-diff gate, the bump script and their tests, build run 2423). Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
This commit is contained in:
1 parent
b7b14b7277
commit
d6837217c0
3 files changed
+14
-14
No files matched your search
@@ -163,15 +163,15 @@ def parse_numbered(text):
|
||||
def parse_patch(text):
|
||||
"""(removed lines, added lines) of a -U0 patch, without the +/- marker."""
|
||||
removed, added = parse_numbered(text)
|
||||
return [line for _, line in removed], [line for _, line in added]
|
||||
return [line for unused, line in removed], [line for unused, line in added]
|
||||
|
||||
|
||||
def version_problem(removed, added):
|
||||
"""A reason when the matrix `version:` lines were moved, lowered or swapped, else None.
|
||||
Both lists are (line number, line); the changed lines must sit at the same line numbers."""
|
||||
if [n for n, _ in removed] != [n for n, _ in added]:
|
||||
if [n for n, unused in removed] != [n for n, unused in added]:
|
||||
return "moves or deletes a line (the changed lines must stay where they are)"
|
||||
for (_, old), (_, new) in zip(removed, added):
|
||||
for (unused, old), (unused, new) in zip(removed, added):
|
||||
old_m, new_m = VERSION_LINE.match(old), VERSION_LINE.match(new)
|
||||
if old_m and new_m and civ.parse_version(new_m["v"]) <= civ.parse_version(old_m["v"]):
|
||||
return f"does not raise a version ({old_m['v']} -> {new_m['v']})"
|
||||
@@ -194,7 +194,7 @@ def check(entries, patch_of):
|
||||
problems.append(f"{path}: a pin change removes and adds at least one line; this diff has "
|
||||
f"{len(removed)} removed and {len(added)} added (binary or empty change?)")
|
||||
continue
|
||||
reason = file_problem(path, [line for _, line in removed], [line for _, line in added])
|
||||
reason = file_problem(path, [line for unused, line in removed], [line for unused, line in added])
|
||||
if not reason and path == civ.MATRIX_FILE:
|
||||
reason = version_problem(removed, added)
|
||||
if reason:
|
||||
|
||||
Reference in new issue
Block a user