summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniƫl van Noord <13665637+DanielNoord@users.noreply.github.com>2021-09-14 23:03:02 +0200
committerGitHub <noreply@github.com>2021-09-14 23:03:02 +0200
commit0687d5caf7a57ebf9c82126e92a3c223d724f5b5 (patch)
tree11b0b3501538149c7bc9a70e6745d2817f423f8a
parent5b99e12a686b50510e77764a059b80bec176a085 (diff)
downloadpylint-git-0687d5caf7a57ebf9c82126e92a3c223d724f5b5.tar.gz
Change lines to lists (#5009)
-rw-r--r--pylint/checkers/base.py6
-rw-r--r--pylint/checkers/raw_metrics.py4
-rw-r--r--pylint/lint/report_functions.py4
3 files changed, 7 insertions, 7 deletions
diff --git a/pylint/checkers/base.py b/pylint/checkers/base.py
index 2ca79453a..d839d921e 100644
--- a/pylint/checkers/base.py
+++ b/pylint/checkers/base.py
@@ -412,7 +412,7 @@ 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)
@@ -420,14 +420,14 @@ def report_by_type_stats(sect, stats, old_stats):
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))
diff --git a/pylint/checkers/raw_metrics.py b/pylint/checkers/raw_metrics.py
index eb3f717ff..028c68e7a 100644
--- a/pylint/checkers/raw_metrics.py
+++ b/pylint/checkers/raw_metrics.py
@@ -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]
@@ -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))
diff --git a/pylint/lint/report_functions.py b/pylint/lint/report_functions.py
index fd316c611..21cb3b824 100644
--- a/pylint/lint/report_functions.py
+++ b/pylint/lint/report_functions.py
@@ -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))