Skip to content

Commit 5c002d4

Browse files
benjaminramsdenBen Ramsden
andauthored
Allow info level logs (#878)
* allow info level logs * new line * no new line style Co-authored-by: Ben Ramsden <[email protected]>
1 parent e9c7e9b commit 5c002d4

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

pyls/plugins/pycodestyle_lint.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,5 +78,13 @@ def error(self, line_number, offset, text, check):
7878
'message': text,
7979
'code': code,
8080
# Are style errors really ever errors?
81-
'severity': lsp.DiagnosticSeverity.Warning
81+
'severity': _get_severity(code)
8282
})
83+
84+
85+
def _get_severity(code):
86+
# Are style errors ever really errors?
87+
if code[0] == 'E' or code[0] == 'W':
88+
return lsp.DiagnosticSeverity.Warning
89+
# If no severity is specified, why wouldn't this be informational only?
90+
return lsp.DiagnosticSeverity.Information

0 commit comments

Comments
 (0)