feat(checker): add debug diagnostics
This commit is contained in:
@@ -9,6 +9,7 @@ class DiagnosticType(StrEnum):
|
|||||||
ERROR = "Error"
|
ERROR = "Error"
|
||||||
WARNING = "Warning"
|
WARNING = "Warning"
|
||||||
INFO = "Info"
|
INFO = "Info"
|
||||||
|
DEBUG = "Debug"
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True)
|
||||||
|
|||||||
@@ -61,3 +61,10 @@ class FileReporter:
|
|||||||
location=location,
|
location=location,
|
||||||
message=message,
|
message=message,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def debug(self, location: Location, message: str):
|
||||||
|
self.report(
|
||||||
|
type=DiagnosticType.DEBUG,
|
||||||
|
location=location,
|
||||||
|
message=message,
|
||||||
|
)
|
||||||
|
|||||||
@@ -59,6 +59,7 @@ class DiagnosticPrinter:
|
|||||||
DiagnosticType.ERROR: Ansi.RED,
|
DiagnosticType.ERROR: Ansi.RED,
|
||||||
DiagnosticType.WARNING: Ansi.YELLOW,
|
DiagnosticType.WARNING: Ansi.YELLOW,
|
||||||
DiagnosticType.INFO: Ansi.CYAN,
|
DiagnosticType.INFO: Ansi.CYAN,
|
||||||
|
DiagnosticType.DEBUG: Ansi.MAGENTA,
|
||||||
}.get(diagnostic.type, Ansi.WHITE)
|
}.get(diagnostic.type, Ansi.WHITE)
|
||||||
|
|
||||||
subject: str = Ansi.FG(color) + line[start_offset:end_offset] + Ansi.RESET
|
subject: str = Ansi.FG(color) + line[start_offset:end_offset] + Ansi.RESET
|
||||||
|
|||||||
Reference in New Issue
Block a user