aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes/python.el
diff options
context:
space:
mode:
authorAugusto Stoffel2022-08-13 17:39:57 +0200
committerStefan Kangas2022-08-19 14:59:27 +0200
commit275cef9e06b406c6e68ec5cf9fe882ab0fde8999 (patch)
treefce3e37a12e2f4874c156acc77c5c2fdfc13548b /lisp/progmodes/python.el
parentec347aec0fc7d2d3e6603b6694d9978cb9fcb9e9 (diff)
downloademacs-275cef9e06b406c6e68ec5cf9fe882ab0fde8999.tar.gz
emacs-275cef9e06b406c6e68ec5cf9fe882ab0fde8999.zip
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 recent versions of pyflakes. (Bug#53913)
Diffstat (limited to 'lisp/progmodes/python.el')
-rw-r--r--lisp/progmodes/python.el14
1 files changed, 9 insertions, 5 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 285a57348e0..5fffb4b7d3d 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -5648,9 +5648,13 @@ returned as is."
5648This is a non empty list of strings, the checker tool possibly followed by 5648This is a non empty list of strings, the checker tool possibly followed by
5649required arguments. Once launched it will receive the Python source to be 5649required arguments. Once launched it will receive the Python source to be
5650checked as its standard input. 5650checked as its standard input.
5651To use `flake8' you would set this to (\"flake8\" \"-\")." 5651To use `flake8' you would set this to (\"flake8\" \"-\").
5652To use `pylint' you would set this to (\"pylint\" \"--from-stdin\" \"stdin\")."
5652 :version "26.1" 5653 :version "26.1"
5653 :type '(repeat string)) 5654 :type '(choice (const :tag "Pyflakes" ("pyflakes"))
5655 (const :tag "Flake8" ("flake8" "-"))
5656 (const :tag "Pylint" ("pylint" "--from-stdin" "stdin"))
5657 (repeat :tag "Custom command" string)))
5654 5658
5655;; The default regexp accommodates for older pyflakes, which did not 5659;; The default regexp accommodates for older pyflakes, which did not
5656;; report the column number, and at the same time it's compatible with 5660;; report the column number, and at the same time it's compatible with
@@ -5658,7 +5662,7 @@ To use `flake8' you would set this to (\"flake8\" \"-\")."
5658;; TYPE 5662;; TYPE
5659(defcustom python-flymake-command-output-pattern 5663(defcustom python-flymake-command-output-pattern
5660 (list 5664 (list
5661 "^\\(?:<?stdin>?\\):\\(?1:[0-9]+\\):\\(?:\\(?2:[0-9]+\\):\\)? \\(?3:.*\\)$" 5665 "^\\(?:<?stdin>?\\):\\(?1:[0-9]+\\):\\(?:\\(?2:[0-9]+\\):?\\)? \\(?3:.*\\)$"
5662 1 2 nil 3) 5666 1 2 nil 3)
5663 "Specify how to parse the output of `python-flymake-command'. 5667 "Specify how to parse the output of `python-flymake-command'.
5664The value has the form (REGEXP LINE COLUMN TYPE MESSAGE): if 5668The value has the form (REGEXP LINE COLUMN TYPE MESSAGE): if
@@ -5670,7 +5674,6 @@ MESSAGE'th gives the message text itself.
5670If COLUMN or TYPE are nil or that index didn't match, that 5674If COLUMN or TYPE are nil or that index didn't match, that
5671information is not present on the matched line and a default will 5675information is not present on the matched line and a default will
5672be used." 5676be used."
5673 :version "26.1"
5674 :type '(list regexp 5677 :type '(list regexp
5675 (integer :tag "Line's index") 5678 (integer :tag "Line's index")
5676 (choice 5679 (choice
@@ -5679,7 +5682,8 @@ be used."
5679 (choice 5682 (choice
5680 (const :tag "No type" nil) 5683 (const :tag "No type" nil)
5681 (integer :tag "Type's index")) 5684 (integer :tag "Type's index"))
5682 (integer :tag "Message's index"))) 5685 (integer :tag "Message's index"))
5686 :version "29.1")
5683 5687
5684(defcustom python-flymake-msg-alist 5688(defcustom python-flymake-msg-alist
5685 '(("\\(^redefinition\\|.*unused.*\\|used$\\)" . :warning)) 5689 '(("\\(^redefinition\\|.*unused.*\\|used$\\)" . :warning))