branch: elpa/flymake-collection
commit ebaae4d236acda331651ff762c2ad3bd708b7e6f
Author: Mohsin Kaleem <mohk...@kisara.moe>
Commit: Mohsin Kaleem <mohk...@kisara.moe>

    build: Fix ruff regression with code not set for SyntaxError
---
 src/checkers/flymake-collection-ruff.el | 4 +++-
 tests/checkers/test-cases/ruff.yml      | 5 ++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/checkers/flymake-collection-ruff.el 
b/src/checkers/flymake-collection-ruff.el
index d7447540b2..9f67d60214 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 b9ff58e8e9..1887b44119 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)"

Reply via email to