Skip to content

Commit

Permalink
Add default value to MessageStyle
Browse files Browse the repository at this point in the history
  • Loading branch information
cdce8p authored and Pierre-Sassoulas committed Oct 17, 2021
1 parent 3acc153 commit 06a70a2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pylint/reporters/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class MessageStyle(NamedTuple):
"""The color name (see `ANSI_COLORS` for available values)
or the color number when 256 colors are available
"""
style: Tuple[str, ...]
style: Tuple[str, ...] = ()
"""Tuple of style strings (see `ANSI_COLORS` for available values).
"""

Expand Down Expand Up @@ -237,10 +237,10 @@ class ColorizedTextReporter(TextReporter):

name = "colorized"
COLOR_MAPPING: ColorMappingDict = {
"I": MessageStyle("green", ()),
"I": MessageStyle("green"),
"C": MessageStyle(None, ("bold",)),
"R": MessageStyle("magenta", ("bold", "italic")),
"W": MessageStyle("magenta", ()),
"W": MessageStyle("magenta"),
"E": MessageStyle("red", ("bold",)),
"F": MessageStyle("red", ("bold", "underline")),
"S": MessageStyle("yellow", ("inverse",)), # S stands for module Separator
Expand Down Expand Up @@ -299,7 +299,7 @@ def __init__(

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

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

0 comments on commit 06a70a2

Please sign in to comment.