From d6881e29a3e9f748ab21d01c02640485d41c7c5a Mon Sep 17 00:00:00 2001 From: Julian Hossbach Date: Fri, 17 Jun 2022 08:59:59 +0200 Subject: [PATCH] Severity level for flake8 error --- pylsp/plugins/flake8_lint.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pylsp/plugins/flake8_lint.py b/pylsp/plugins/flake8_lint.py index 5c77e1d3..6be83b99 100644 --- a/pylsp/plugins/flake8_lint.py +++ b/pylsp/plugins/flake8_lint.py @@ -173,6 +173,9 @@ def parse_stdout(document, stdout): character = int(character) - 1 # show also the code in message msg = code + ' ' + msg + severity = lsp.DiagnosticSeverity.Warning + if code[0] == "E": + severity = lsp.DiagnosticSeverity.Error diagnostics.append( { 'source': 'flake8', @@ -189,7 +192,7 @@ def parse_stdout(document, stdout): } }, 'message': msg, - 'severity': lsp.DiagnosticSeverity.Warning, + 'severity': severity, } )