Skip to content

Commit

Permalink
Merge branch 'main' into add-typing-in-reporters
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre-Sassoulas committed Sep 15, 2021
2 parents de699c6 + 0687d5c commit 312d3a4
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 @@ -32,8 +32,8 @@ def report_messages_stats(sect: Section, stats: Dict[str, Any], _: Dict) -> None
in_order.reverse()
lines: List[str] = ["message id", "occurrences"]
for value, msg_id in in_order:
lines += (msg_id, str(value))
sect.append(Table(children=lines, cols=2, rheaders=1))
lines += [msg_id, str(value)]
sect.append(report_nodes.Table(children=lines, cols=2, rheaders=1))


def report_messages_by_module_stats(
Expand Down

0 comments on commit 312d3a4

Please sign in to comment.