summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Sassoulas <pierre.sassoulas@gmail.com>2021-11-07 23:19:02 +0100
committerPierre Sassoulas <pierre.sassoulas@gmail.com>2021-11-07 23:30:46 +0100
commit47b9a4e9e9ca2e55c13dd56c25e33c8bad532e1d (patch)
tree96a6c7081fd0439cd9c2496d44b13702f51f2baa
parent12f2842fff3beefec621212247ae87523b0d7103 (diff)
downloadpylint-git-47b9a4e9e9ca2e55c13dd56c25e33c8bad532e1d.tar.gz
Add independant typing for ModuleStats attribute
-rw-r--r--pylint/utils/linterstats.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/pylint/utils/linterstats.py b/pylint/utils/linterstats.py
index 5729ca40c..a9b3708c9 100644
--- a/pylint/utils/linterstats.py
+++ b/pylint/utils/linterstats.py
@@ -73,6 +73,10 @@ class ModuleStats(TypedDict):
warning: int
+ModuleStatsAttribute = Literal[
+ "convention", "error", "fatal", "info", "refactor", "statement", "warning"
+]
+
# pylint: disable-next=too-many-instance-attributes
class LinterStats:
"""Class used to linter stats"""
@@ -284,12 +288,7 @@ class LinterStats:
setattr(self, type_name, getattr(self, type_name) + increase)
def increase_single_module_message_count(
- self,
- modname: str,
- type_name: Literal[
- "convention", "error", "fatal", "info", "refactor", "statement", "warning"
- ],
- increase: int,
+ self, modname: str, type_name: ModuleStatsAttribute, increase: int
) -> None:
"""Increase the message type count of an individual message type of a module"""
self.by_module[modname][type_name] += increase