Skip to content

Commit 0a3f447

Browse files
committed
Add default value to MessageStyle
1 parent fd3d20a commit 0a3f447

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pylint/reporters/text.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class MessageStyle(NamedTuple):
5757
"""The color name (see `ANSI_COLORS` for available values)
5858
or the color number when 256 colors are available
5959
"""
60-
style: Tuple[str, ...]
60+
style: Tuple[str, ...] = ()
6161
"""Tuple of style strings (see `ANSI_COLORS` for available values).
6262
"""
6363

@@ -237,10 +237,10 @@ class ColorizedTextReporter(TextReporter):
237237

238238
name = "colorized"
239239
COLOR_MAPPING: ColorMappingDict = {
240-
"I": MessageStyle("green", ()),
240+
"I": MessageStyle("green"),
241241
"C": MessageStyle(None, ("bold",)),
242242
"R": MessageStyle("magenta", ("bold", "italic")),
243-
"W": MessageStyle("magenta", ()),
243+
"W": MessageStyle("magenta"),
244244
"E": MessageStyle("red", ("bold",)),
245245
"F": MessageStyle("red", ("bold", "underline")),
246246
"S": MessageStyle("yellow", ("inverse",)), # S stands for module Separator
@@ -299,7 +299,7 @@ def __init__(
299299

300300
def _get_decoration(self, msg_id: str) -> MessageStyle:
301301
"""Returns the message style as defined in self.color_mapping"""
302-
return self.color_mapping.get(msg_id[0]) or MessageStyle(None, ())
302+
return self.color_mapping.get(msg_id[0]) or MessageStyle(None)
303303

304304
def handle_message(self, msg: Message) -> None:
305305
"""manage message of different types, and colorize output

0 commit comments

Comments
 (0)