8000 Report Flake8 errors with Error severity level by lcheylus · Pull Request #234 · python-lsp/python-lsp-server · GitHub
[go: up one dir, main page]

Skip to content

Report Flake8 errors with Error severity level #234

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pylsp/plugins/flake8_lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def parse_stdout(document, stdout):
# show also the code in message
msg = code + ' ' + msg
severity = lsp.DiagnosticSeverity.Warning
if code[0] == "E":
if code == "E999" or code[0] == "F":
severity = lsp.DiagnosticSeverity.Error
diagnostics.append(
{
Expand Down
4 changes: 2 additions & 2 deletions test/plugins/test_flake8_lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def test_flake8_unsaved(workspace):
assert unused_var['code'] == 'F841'
assert unused_var['range']['start'] == {'line': 5, 'character': 1}
assert unused_var['range']['end'] == {'line': 5, 'character': 11}
assert unused_var['severity'] == lsp.DiagnosticSeverity.Warning
assert unused_var['severity'] == lsp.DiagnosticSeverity.Error


def test_flake8_lint(workspace):
Expand All @@ -53,7 +53,7 @@ def test_flake8_lint(workspace):
assert unused_var['code'] == 'F841'
assert unused_var['range']['start'] == {'line': 5, 'character': 1}
assert unused_var['range']['end'] == {'line': 5, 'character': 11}
assert unused_var['severity'] == lsp.DiagnosticSeverity.Warning
assert unused_var['severity'] == lsp.DiagnosticSeverity.Error
finally:
os.remove(name)

Expand Down
0