Created
January 13, 2015 06:05
-
-
Save nkpart/dadef2be40d27f58ec95 to your computer and use it in GitHub Desktop.
A flycheck checker that runs the haskell variant of doctest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(flycheck-define-checker haskell-doctest | |
"Haskell doctest checker" | |
:command ("doctest" source) | |
:error-patterns | |
((error line-start "### Failure in " (file-name) ":" line ":" ;;line-end) | |
(message (one-or-more not-newline) | |
(one-or-more "\n" | |
(or (one-or-more " ") | |
"expected") | |
(one-or-more not-newline)) | |
line-end))) | |
:modes haskell-mode) | |
(flycheck-add-next-checker 'haskell-hlint '(info . haskell-doctest)) | |
(add-to-list 'flycheck-checkers 'haskell-doctest 'append) | |
;; Errors are expected to look something like this: | |
;; ### Failure in Wat.hs:43: expression `Nothing :: Maybe Int' | |
;; expected: Just 3 | |
;; but got: Nothing | |
;; Examples: 12 Tried: 6 Errors: 0 Failures: 2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment