Skip to content

Commit fcdb82c

Browse files
committed
feat: make clearer error messages
Also remove +{line} if we don't have line information
1 parent 3d45603 commit fcdb82c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pyrde/diagnostics.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ def finish(self):
111111

112112
def send(self, diagnostic: Diagnostic):
113113
message = (diagnostic.long_format or diagnostic.format).format(**diagnostic.args)
114-
print(f"{SEVERITIES_AS_TEXT[diagnostic.severity]} {diagnostic.path} +{diagnostic.start_line} {message}", file=sys.stderr, flush=True)
114+
line_info = f"+{diagnostic.start_line} " if diagnostic.start_line else ""
115+
print(f"{SEVERITIES_AS_TEXT[diagnostic.severity]} {diagnostic.code} {diagnostic.path} {line_info}\n {message}\n", file=sys.stderr, flush=True)
115116

116117

117118
class ReviewdogDiagnosticListener(DiagnosticListener):

0 commit comments

Comments
 (0)