Commit fb90bf3f authored by Steve Purcell's avatar Steve Purcell Committed by Sebastian Wiesner

Add syntax checker for LESS

parent 1a5f3ce6
......@@ -17,6 +17,7 @@
(depends-on "web-mode")
(depends-on "js2-mode")
(depends-on "js3-mode")
(depends-on "less-css-mode")
(depends-on "lua-mode")
(depends-on "cperl-mode")
(depends-on "php-mode")
......
......@@ -39,6 +39,7 @@ Features
- HTML
- Javascript
- JSON
- LESS
- Lua
- Perl
- PHP
......
......@@ -17,6 +17,7 @@ order of their appearance in the default value of
@iflyc html-tidy
@iflyc javascript-jshint
@iflyc json-jsonlint
@iflyc less
@iflyc lua
@iflyc perl
@iflyc php
......
......@@ -72,6 +72,8 @@ Javascript (using @command{jshint})
@item
JSON (using @command{jsonlint})
@item
LESS (using @command{lessc})
@item
Lua
@item
Perl
......
......@@ -120,6 +120,7 @@ buffer-local wherever it is set."
html-tidy
javascript-jshint
json-jsonlint
less
lua
perl
php
......@@ -2921,6 +2922,16 @@ See URL `https://github.com/zaach/jsonlint'."
(and buffer-file-name
(string= "json" (file-name-extension buffer-file-name))))))
(flycheck-declare-checker less
"A LESS syntax checker using lessc.
At least version 1.4 of lessc is required.
See URL `http://lesscss.org'."
:command '("lessc" "--lint" "--no-color" source)
:error-patterns
'(("^\\(?4:[^\e\n]*\\|FileError:.*\n\\) in \\(?1:[^ \r\n\t\e]+\\)\\(?::\\| on line \\)\\(?2:[0-9]+\\)\\(?::\\|, column \\)\\(?3:[0-9]+\\):?" error))
:modes 'less-css-mode)
(flycheck-declare-checker lua
"A Lua syntax checker using the Lua compiler.
......
......@@ -140,6 +140,7 @@
web-mode
js2-mode
js3-mode
less-css-mode
lua-mode
cperl-mode
php-mode
......@@ -2204,6 +2205,18 @@ See URL `https://github.com/lunaryorn/flycheck/issues/45' and URL
"checkers/json-jsonlint-error.json" 'text-mode nil
'(1 42 "found: ',' - expected: 'EOF'." error)))
(ert-deftest checker-less-file-error ()
:expected-result (flycheck-testsuite-fail-unless-checker 'less)
(flycheck-testsuite-should-syntax-check
"checkers/less-file-error.less" 'less-css-mode nil
'(3 1 "FileError: 'no-such-file.less' wasn't found" error)))
(ert-deftest checker-less-syntax-error ()
:expected-result (flycheck-testsuite-fail-unless-checker 'less)
(flycheck-testsuite-should-syntax-check
"checkers/less-syntax-error.less" 'less-css-mode nil
'(2 1 "ParseError: missing closing `}`" error)))
(ert-deftest checker-lua-syntax-error ()
:expected-result (flycheck-testsuite-fail-unless-checker 'lua)
(flycheck-testsuite-should-syntax-check
......
.something {}
@import "no-such-file.less";
#otherthing {
}
......@@ -137,7 +137,8 @@ npm coffeelint \
coffee-script \
csslint \
jshint \
jsonlint
jsonlint \
less
gem haml \
rubocop \
......
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