From 8d98dc3493acfb6a1e04f299a2f8e919748c86d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20Ho=C3=9Fbach?= Date: Mon, 15 Jul 2024 15:49:34 +0200 Subject: [PATCH 1/2] update deprecated e999 check --- pylsp_ruff/plugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pylsp_ruff/plugin.py b/pylsp_ruff/plugin.py index ed6156f..d0831f2 100644 --- a/pylsp_ruff/plugin.py +++ b/pylsp_ruff/plugin.py @@ -210,7 +210,7 @@ def create_diagnostic(check: RuffCheck, settings: PluginSettings) -> Diagnostic: # Ruff intends to implement severity codes in the future, # see https://github.com/charliermarsh/ruff/issues/645. severity = DiagnosticSeverity.Warning - if check.code == "E999" or check.code[0] == "F": + if check.code == "None" or check.code[0] == "F": severity = DiagnosticSeverity.Error # Check if check.code starts contained in given severities From c8ca162dd6d3289bc316fd15bf9f1ef7e17207e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20Ho=C3=9Fbach?= Date: Tue, 16 Jul 2024 12:58:12 +0200 Subject: [PATCH 2/2] keep old e999 check for compatibilty --- .pre-commit-config.yaml | 4 ++-- pylsp_ruff/plugin.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9cb029a..58ca9e2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,12 +1,12 @@ repos: - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.991 + rev: v1.10.1 hooks: - id: mypy args: [--ignore-missing-imports] - repo: https://github.com/charliermarsh/ruff-pre-commit - rev: v0.2.1 + rev: v0.5.2 hooks: # Run the linter. - id: ruff diff --git a/pylsp_ruff/plugin.py b/pylsp_ruff/plugin.py index d0831f2..833f16b 100644 --- a/pylsp_ruff/plugin.py +++ b/pylsp_ruff/plugin.py @@ -210,7 +210,7 @@ def create_diagnostic(check: RuffCheck, settings: PluginSettings) -> Diagnostic: # Ruff intends to implement severity codes in the future, # see https://github.com/charliermarsh/ruff/issues/645. severity = DiagnosticSeverity.Warning - if check.code == "None" or check.code[0] == "F": + if check.code == "None" or check.code == "E999" or check.code[0] == "F": severity = DiagnosticSeverity.Error # Check if check.code starts contained in given severities