Commit 3fb4bdc0 authored by Robert O'Connor's avatar Robert O'Connor Committed by Sebastian Wiesner

Add a checker for Jade files

Fix the lack of a checker for the Jade, a templating language
for Node.js (#680).
parent fdd1efb4
......@@ -21,6 +21,7 @@
(depends-on "haml-mode")
(depends-on "handlebars-mode")
(depends-on "haskell-mode")
(depends-on "jade-mode")
(depends-on "js2-mode")
(depends-on "js3-mode")
(depends-on "less-css-mode")
......
......@@ -383,6 +383,13 @@ with the following option:
@end itemize
@flyclanguage{Jade}
@itemize
@item
@flyc{jade} (using @uref{http://jade-lang.com/,Jade})
@end itemize
@flyclanguage{Javascript}
@enumerate
......
......@@ -235,6 +235,7 @@ attention to case differences."
haskell-ghc
haskell-hlint
html-tidy
jade
javascript-jshint
javascript-eslint
javascript-gjslint
......@@ -6343,6 +6344,23 @@ See URL `https://github.com/w3c/tidy-html5'."
" - Warning: " (message) line-end))
:modes (html-mode nxhtml-mode))
(flycheck-define-checker jade
"A Jade syntax checker using the Jade compiler.
See URL `http://jade-lang.com'."
:command ("jade" source)
:error-patterns
;; The pattern is based on the pattern in
;; https://github.com/tardyp/SublimeLinter-jade/blob/master/linter.py#L23;
;; tweaked slightly to:
;; Error: (\S+):(\d+).*\r?\n(?:.*\|.*\n)+.*\n(.*)
((error line-start
"Error: " (file-name) ":" line (zero-or-more not-newline) "\n"
(one-or-more (and (zero-or-more not-newline) "|"
(zero-or-more not-newline) "\n"))
(zero-or-more not-newline) "\n" (message) line-end))
:modes jade-mode)
(flycheck-def-config-file-var flycheck-jshintrc javascript-jshint ".jshintrc"
:safe #'stringp)
......
......@@ -4333,6 +4333,11 @@ Why not:
'(8 5 warning "discarding unexpected <spam>"
:checker html-tidy)))
(flycheck-ert-def-checker-test jade jade nil
(flycheck-ert-should-syntax-check
"checkers/jade-error.jade" 'jade-mode
'(2 nil error "unexpected token \"indent\"" :checker jade)))
(flycheck-ert-def-checker-test javascript-jshint javascript syntax-error
:tags '(checkstyle-xml)
;; Silence JS2 and JS3 parsers
......
doctype html
html
head
title Jade Examples
body
h1 Markup example
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment