From 8da14756eea777b810cbae7f6fbeb4e8f2a91128 Mon Sep 17 00:00:00 2001 From: Ben Ramsden Date: Thu, 22 Oct 2020 16:18:13 +0100 Subject: [PATCH 1/3] allow info level logs --- pyls/plugins/pycodestyle_lint.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pyls/plugins/pycodestyle_lint.py b/pyls/plugins/pycodestyle_lint.py index bfdaf8b4..2b2c5dc8 100644 --- a/pyls/plugins/pycodestyle_lint.py +++ b/pyls/plugins/pycodestyle_lint.py @@ -78,5 +78,13 @@ def error(self, line_number, offset, text, check): 'message': text, 'code': code, # Are style errors really ever errors? - 'severity': lsp.DiagnosticSeverity.Warning + 'severity': _get_severity(code) }) + + +def _get_severity(code): + # Are style errors ever really errors? + if code[0] == 'E' or code[0] == 'W': + return lsp.DiagnosticSeverity.Warning + # If no severity is specified, why wouldn't this be informational only? + return lsp.DiagnosticSeverity.Information \ No newline at end of file From 101bd2e552f3b232390d2232682a4278fe93f791 Mon Sep 17 00:00:00 2001 From: Ben Ramsden Date: Fri, 23 Oct 2020 16:27:20 +0100 Subject: [PATCH 2/3] new line --- pyls/plugins/pycodestyle_lint.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyls/plugins/pycodestyle_lint.py b/pyls/plugins/pycodestyle_lint.py index 2b2c5dc8..206c0024 100644 --- a/pyls/plugins/pycodestyle_lint.py +++ b/pyls/plugins/pycodestyle_lint.py @@ -87,4 +87,5 @@ def _get_severity(code): if code[0] == 'E' or code[0] == 'W': return lsp.DiagnosticSeverity.Warning # If no severity is specified, why wouldn't this be informational only? - return lsp.DiagnosticSeverity.Information \ No newline at end of file + return lsp.DiagnosticSeverity.Information + From a821a461ba50aa175ddf96dea3bcb352e7b8858f Mon Sep 17 00:00:00 2001 From: Ben Ramsden Date: Fri, 23 Oct 2020 16:39:59 +0100 Subject: [PATCH 3/3] no new line style --- pyls/plugins/pycodestyle_lint.py | 1 - 1 file changed, 1 deletion(-) diff --git a/pyls/plugins/pycodestyle_lint.py b/pyls/plugins/pycodestyle_lint.py index 206c0024..a6fcd5fe 100644 --- a/pyls/plugins/pycodestyle_lint.py +++ b/pyls/plugins/pycodestyle_lint.py @@ -88,4 +88,3 @@ def _get_severity(code): return lsp.DiagnosticSeverity.Warning # If no severity is specified, why wouldn't this be informational only? return lsp.DiagnosticSeverity.Information -