Skip to content

Commit fdf2b22

Browse files
authored
Change severity level for flake8 errors (#223)
Severity level for flake8 error
1 parent f44a123 commit fdf2b22

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pylsp/plugins/flake8_lint.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,9 @@ def parse_stdout(document, stdout):
173173
character = int(character) - 1
174174
# show also the code in message
175175
msg = code + ' ' + msg
176+
severity = lsp.DiagnosticSeverity.Warning
177+
if code[0] == "E":
178+
severity = lsp.DiagnosticSeverity.Error
176179
diagnostics.append(
177180
{
178181
'source': 'flake8',
@@ -189,7 +192,7 @@ def parse_stdout(document, stdout):
189192
}
190193
},
191194
'message': msg,
192-
'severity': lsp.DiagnosticSeverity.Warning,
195+
'severity': severity,
193196
}
194197
)
195198

0 commit comments

Comments
 (0)