Skip to content

Commit

Permalink
Change lines to lists (#5009)
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielNoord committed Sep 14, 2021
1 parent 5b99e12 commit 0687d5c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions pylint/checkers/base.py
Expand Up @@ -412,22 +412,22 @@ def report_by_type_stats(sect, stats, old_stats):
nice_stats[node_type]["percent_badname"] = f"{percent:.2f}"
except KeyError:
nice_stats[node_type]["percent_badname"] = "NC"
lines = ("type", "number", "old number", "difference", "%documented", "%badname")
lines = ["type", "number", "old number", "difference", "%documented", "%badname"]
for node_type in ("module", "class", "method", "function"):
new = stats[node_type]
old = old_stats.get(node_type, None)
if old is not None:
diff_str = lint_utils.diff_string(old, new)
else:
old, diff_str = "NC", "NC"
lines += (
lines += [
node_type,
str(new),
str(old),
diff_str,
nice_stats[node_type].get("percent_documented", "0"),
nice_stats[node_type].get("percent_badname", "0"),
)
]
sect.append(reporter_nodes.Table(children=lines, cols=6, rheaders=1))


Expand Down
4 changes: 2 additions & 2 deletions pylint/checkers/raw_metrics.py
Expand Up @@ -30,7 +30,7 @@ def report_raw_stats(sect, stats, old_stats):
if not total_lines:
raise EmptyReportError()
sect.description = f"{total_lines} lines have been analyzed"
lines = ("type", "number", "%", "previous", "difference")
lines = ["type", "number", "%", "previous", "difference"]
for node_type in ("code", "docstring", "comment", "empty"):
key = node_type + "_lines"
total = stats[key]
Expand All @@ -40,7 +40,7 @@ def report_raw_stats(sect, stats, old_stats):
diff_str = diff_string(old, total)
else:
old, diff_str = "NC", "NC"
lines += (node_type, str(total), f"{percent:.2f}", str(old), diff_str)
lines += [node_type, str(total), f"{percent:.2f}", str(old), diff_str]
sect.append(Table(children=lines, cols=5, rheaders=1))


Expand Down
4 changes: 2 additions & 2 deletions pylint/lint/report_functions.py
Expand Up @@ -27,9 +27,9 @@ def report_messages_stats(sect, stats, _):
if not msg_id.startswith("I")
)
in_order.reverse()
lines = ("message id", "occurrences")
lines = ["message id", "occurrences"]
for value, msg_id in in_order:
lines += (msg_id, str(value))
lines += [msg_id, str(value)]
sect.append(report_nodes.Table(children=lines, cols=2, rheaders=1))


Expand Down

0 comments on commit 0687d5c

Please sign in to comment.