branch: elpa/flymake-pyrefly
commit b1c5dc32cee7bfea72d2561f5388dd9dfa5332b1
Author: Boris Shminke <bo...@shminke.com>
Commit: Boris Shminke <bo...@shminke.com>

    use rx notation
---
 flymake-pyrefly.el | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/flymake-pyrefly.el b/flymake-pyrefly.el
index 4dbfd00b98..3c446af1ec 100644
--- a/flymake-pyrefly.el
+++ b/flymake-pyrefly.el
@@ -85,7 +85,20 @@
                       ;; of objects, and call `report-fn'.
                       (cl-loop
                        while (search-forward-regexp
-                              "^\\([A-Z]+\\) 
.+\.py:\\([0-9]+\\):\\([0-9]+\\)\-\\([0-9]+\\): \\(.*\\)$"
+                              (rx line-start
+                                  ;; diagnostic level (error, warn, etc)
+                                  (group (one-or-more upper-case))
+                                  ;; file name
+                                  (one-or-more anything) ".py:"
+                                  ;; line number
+                                  (group (one-or-more digit)) ":"
+                                  ;; start column
+                                  (group (one-or-more digit)) "-"
+                                  ;; end column
+                                  (group (one-or-more digit)) ": "
+                                  ;; diagnostic message
+                                  (group (one-or-more anything))
+                                  line-end)
                               nil t)
                        for msg = (match-string 5)
                        for beg = (cons (string-to-number (match-string 2))

Reply via email to