diff --git a/pyls/plugins/pycodestyle_lint.py b/pyls/plugins/pycodestyle_lint.py index bfdaf8b4..a6fcd5fe 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