Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pylint/checkers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ def table_lines_from_stats(
("error", "NC"),
]

for index, _ in enumerate(new):
new_value = new[index][1]
for index, value in enumerate(new):
new_value = value[1]
old_value = old[index][1]
diff_str = (
diff_string(old_value, new_value)
Expand All @@ -134,7 +134,7 @@ def table_lines_from_stats(
)
new_str = f"{new_value:.3f}" if isinstance(new_value, float) else str(new_value)
old_str = f"{old_value:.3f}" if isinstance(old_value, float) else str(old_value)
lines.extend((new[index][0].replace("_", " "), new_str, old_str, diff_str))
lines.extend((value[0].replace("_", " "), new_str, old_str, diff_str))
return lines


Expand Down
8 changes: 4 additions & 4 deletions pylint/checkers/refactoring/refactoring_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -578,12 +578,12 @@ def process_tokens(self, tokens):
token_string = token[1]
if token_string == "elif":
# AST exists by the time process_tokens is called, so
# it's safe to assume tokens[index+1]
# exists. tokens[index+1][2] is the elif's position as
# it's safe to assume tokens[index+1] exists.
# tokens[index+1][2] is the elif's position as
# reported by CPython and PyPy,
# tokens[index][2] is the actual position and also is
# token[2] is the actual position and also is
# reported by IronPython.
self._elifs.extend([tokens[index][2], tokens[index + 1][2]])
self._elifs.extend([token[2], tokens[index + 1][2]])
elif _is_trailing_comma(tokens, index):
if self.linter.is_message_enabled("trailing-comma-tuple"):
self.add_message("trailing-comma-tuple", line=token.start[0])
Expand Down