diff --git a/src/checkers/flymake-collection-ruff.el b/src/checkers/flymake-collection-ruff.el index d744754..9f67d60 100644 --- a/src/checkers/flymake-collection-ruff.el +++ b/src/checkers/flymake-collection-ruff.el @@ -71,7 +71,9 @@ See URL `https://github.com/charliermarsh/ruff'." (car loc) (cdr loc) :warning - (concat (propertize .code 'face 'flymake-collection-diag-id) " " .message))))) + (concat (when .code + (concat (propertize .code 'face 'flymake-collection-diag-id) " ")) + .message))))) (provide 'flymake-collection-ruff) diff --git a/tests/checkers/test-cases/ruff.yml b/tests/checkers/test-cases/ruff.yml index b9ff58e..1887b44 100644 --- a/tests/checkers/test-cases/ruff.yml +++ b/tests/checkers/test-cases/ruff.yml @@ -25,4 +25,7 @@ tests: lints: - point: [1, 11] level: warning - message: "E999 SyntaxError: Simple statements must be separated by newlines or semicolons (ruff)" + message: "SyntaxError: Simple statements must be separated by newlines or semicolons (ruff)" + - point: [1, 18] + level: warning + message: "SyntaxError: Simple statements must be separated by newlines or semicolons (ruff)"