Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/DanielNoord/pylint into typ…
Browse files Browse the repository at this point in the history
…ing-filepath
  • Loading branch information
DanielNoord committed Sep 15, 2021
2 parents 4c31342 + a3f3405 commit fa5d6f3
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 9 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
3 changes: 3 additions & 0 deletions setup.cfg
Expand Up @@ -89,6 +89,9 @@ warn_unused_ignores = True
[mypy-astroid.*]
ignore_missing_imports = True
[mypy-tests.*]
ignore_missing_imports = True
[mypy-coverage]
ignore_missing_imports = True
Expand Down
2 changes: 1 addition & 1 deletion tests/pyreverse/test_diadefs.py
Expand Up @@ -26,7 +26,7 @@

import pytest
from astroid import nodes
from conftest import PyreverseConfig # type: ignore #pylint: disable=no-name-in-module
from tests.pyreverse.conftest import PyreverseConfig

from pylint.pyreverse.diadefslib import (
ClassDiadefGenerator,
Expand Down
2 changes: 1 addition & 1 deletion tests/pyreverse/test_writer.py
Expand Up @@ -28,7 +28,7 @@
from unittest.mock import Mock

import pytest
from conftest import PyreverseConfig # type: ignore #pylint: disable=no-name-in-module
from tests.pyreverse.conftest import PyreverseConfig

from pylint.pyreverse.diadefslib import DefaultDiadefGenerator, DiadefsHandler
from pylint.pyreverse.inspector import Linker, Project
Expand Down

0 comments on commit fa5d6f3

Please sign in to comment.