branch: elpa/flycheck commit d56e98f656f02f447d07ceaad965e389254c792a Author: Jimmy Yuen Ho Wong <wyue...@users.noreply.github.com> Commit: GitHub <nore...@github.com>
Fix ruff error-patterns and error-filter (#2079) SyntaxErrors in ruff 0.5.0 has no IDs, which will be filtered out with the existing implementation of error-filter. It is also not surfaced as an error previously. This commit fixes both issues. --- flycheck.el | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/flycheck.el b/flycheck.el index 6b4719624d..fc887b4afc 100644 --- a/flycheck.el +++ b/flycheck.el @@ -10834,12 +10834,20 @@ See URL `https://beta.ruff.rs/docs/'." "-") :standard-input t :error-filter (lambda (errors) - (let ((errors (flycheck-sanitize-errors errors))) - (seq-map #'flycheck-flake8-fix-error-level errors))) + (let* ((errors (flycheck-sanitize-errors errors)) + (errors-with-ids (seq-filter #'flycheck-error-id errors))) + (seq-union + (seq-difference errors errors-with-ids) + (seq-map #'flycheck-flake8-fix-error-level errors-with-ids)))) :error-patterns - ((warning line-start + ((error line-start + (or "-" (file-name)) ":" line ":" (optional column ":") " " + "SyntaxError: " + (message (one-or-more not-newline)) + line-end) + (warning line-start (or "-" (file-name)) ":" line ":" (optional column ":") " " - (id (one-or-more (any alpha)) (one-or-more digit)) " " + (id (one-or-more (any alpha)) (one-or-more digit) " ") (message (one-or-more not-newline)) line-end)) :working-directory flycheck-python-find-project-root