Skip to content

Instantly share code, notes, and snippets.

@BJTerry
Created November 21, 2014 23:53
Show Gist options
  • Save BJTerry/67c4587761cd6a483d77 to your computer and use it in GitHub Desktop.
Save BJTerry/67c4587761cd6a483d77 to your computer and use it in GitHub Desktop.
A flycheck checker for python with prospector
(flycheck-define-checker python-prospector
"A Python syntax and style checker using Prospector.
See URL `http://prospector.readthedocs.org/en/latest/index.html'."
:command ("prospector" "-s" "medium" "-M" "-o" "emacs"
source)
:error-patterns
((error line-start
(file-name) ":" (one-or-more digit) " :" (optional "\r") "\n"
(one-or-more " ") "L" line ":" column
(message (minimal-match (one-or-more not-newline)) "E" (one-or-more digit) (optional "\r") "\n"
(one-or-more not-newline)) (optional "\r") "\n" line-end)
(warning line-start
(file-name) ":" (one-or-more digit) " :" (optional "\r") "\n"
(one-or-more " ") "L" line ":" column
(message (minimal-match (one-or-more not-newline)) "W" (one-or-more digit) (optional "\r") "\n"
(one-or-more not-newline)) (optional "\r") "\n" line-end)
(warning line-start
(file-name) ":" (one-or-more digit) " :" (optional "\r") "\n"
(one-or-more " ") "L" line ":" column
(message (minimal-match (one-or-more not-newline)) (not digit) (one-or-more digit) (optional "\r") "\n"
(one-or-more not-newline)) (optional "\r") "\n" line-end))
:modes python-mode)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment