Commit e890082b authored by Yasuyuki Oka's avatar Yasuyuki Oka Committed by Sebastian Wiesner

Add syntax checker for eRuby using erubis command

parent 1b5b6999
......@@ -26,9 +26,11 @@
(depends-on "js3-mode")
(depends-on "less-css-mode")
(depends-on "lua-mode")
(depends-on "mmm-mode")
(depends-on "php-mode")
(depends-on "puppet-mode")
(depends-on "racket-mode")
(depends-on "rhtml-mode")
(depends-on "rust-mode")
(depends-on "sass-mode")
(depends-on "scala-mode2")
......
......@@ -43,6 +43,7 @@ Features
- Elixir
- Emacs Lisp
- Erlang
- ERuby
- Go
- Haml
- Handlebars
......
......@@ -199,6 +199,8 @@ Emacs Lisp (using the byte compiler and CheckDoc)
@item
Erlang (using @command{erlc})
@item
ERuby (using @command{erubis})
@item
Go (using @command{gofmt}, @command{go build} and @command{go test})
@item
Haml (using @command{haml})
......@@ -3421,6 +3423,7 @@ order of their appearance in the default value of
@iflyc emacs-lisp
@iflyc emacs-lisp-checkdoc
@iflyc erlang
@iflyc eruby-erubis
@iflyc go-gofmt
@iflyc go-build
@iflyc go-test
......
......@@ -145,6 +145,7 @@ buffer-local wherever it is set."
emacs-lisp
emacs-lisp-checkdoc
erlang
eruby-erubis
go-gofmt
go-build
go-test
......@@ -3921,6 +3922,19 @@ The checker runs `checkdoc-current-buffer'."
(error line-start (file-name) ":" line ": " (message) line-end))
:modes erlang-mode)
(flycheck-define-checker eruby-erubis
"A eRuby syntax checker using the `erubis' command.
See URL `http://www.kuwata-lab.com/erubis/'."
:command ("erubis" "-z" source)
:error-patterns
((error line-start (file-name) ":" line ": " (message) line-end))
:predicate
(lambda ()
(or (memq major-mode '(html-erb-mode rhtml-mode))
(and (buffer-file-name)
(member (f-ext (buffer-file-name)) '("erb" "rhtml"))))))
(flycheck-define-checker go-gofmt
"A Go syntax and style checker using the gofmt utility.
......
......@@ -11,7 +11,8 @@ class flycheck::checkers::gems {
$gem_requires = [Class['flycheck::ruby']]
}
$gem_packages = [ 'foodcritic', # chef-foodcritic
$gem_packages = [ 'erubis', # eruby-erubis
'foodcritic', # chef-foodcritic
'haml',
'puppet-lint',
'rubocop', # ruby-rubocop
......
......@@ -3430,6 +3430,13 @@ See URL `https://github.com/flycheck/flycheck/issues/45' and URL
"checkers/erlang-warning.erl" 'erlang-mode
'(6 nil warning "wrong number of arguments in format call" :checker erlang)))
(ert-deftest flycheck-define-checker/eruby-erubis ()
:tags '(builtin-checker external-tool language-eruby)
(skip-unless (flycheck-check-executable 'eruby-erubis))
(flycheck-test-should-syntax-check
"checkers/eruby-error.erb" '(html-erb-mode rhtml-mode)
'(5 nil error "syntax error, unexpected keyword_end" :checker eruby-erubis)))
(ert-deftest flycheck-define-checker/go-gofmt ()
:tags '(builtin-checker external-tool language-go)
"Test a syntax error."
......
<table>
<tr>
<%- (1..9).each do |y| -%>
<th><%= y %></th>
<%= end -%>
</tr>
</table>
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