From d0f754b3d39a8189ba6cc2d09aea0973f79f4ca6 Mon Sep 17 00:00:00 2001 From: Augusto Stoffel Date: Sat, 13 Aug 2022 17:39:57 +0200 Subject: [PATCH 2/4] python.el: Adjustments to Flymake backend * lisp/progmodes/python (python-flymake-command): Advertise possiblity to use pylint. (python-flymake-command-output-pattern): Make compatible with pyflakes version 2.4.0 --- lisp/progmodes/python.el | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 3176d12bd1..be1d3aab00 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -5625,9 +5625,13 @@ python-flymake-command This is a non empty list of strings, the checker tool possibly followed by required arguments. Once launched it will receive the Python source to be checked as its standard input. -To use `flake8' you would set this to (\"flake8\" \"-\")." +To use `flake8' you would set this to (\"flake8\" \"-\"). +To use `pylint' you would set this to (\"pylint\" \"--from-stdin\" \"stdin\")." :version "26.1" - :type '(repeat string)) + :type '(choice (const :tag "Pyflakes" ("pyflakes")) + (const :tag "Flake8" ("flake8" "-")) + (const :tag "Pylint" ("pylint" "--from-stdin" "stdin")) + (repeat :tag "Custom command" string))) ;; The default regexp accommodates for older pyflakes, which did not ;; report the column number, and at the same time it's compatible with @@ -5635,7 +5639,7 @@ python-flymake-command ;; TYPE (defcustom python-flymake-command-output-pattern (list - "^\\(?:?\\):\\(?1:[0-9]+\\):\\(?:\\(?2:[0-9]+\\):\\)? \\(?3:.*\\)$" + "^\\(?:?\\):\\(?1:[0-9]+\\):\\(?:\\(?2:[0-9]+\\):?\\)? \\(?3:.*\\)$" 1 2 nil 3) "Specify how to parse the output of `python-flymake-command'. The value has the form (REGEXP LINE COLUMN TYPE MESSAGE): if -- 2.37.1