Commit 5a86424d authored by Yasuyuki Oka's avatar Yasuyuki Oka Committed by Sebastian Wiesner

Add syntax checker for Slim using Slim compiler

parent 4dc68ba5
......@@ -28,6 +28,7 @@
(depends-on "sass-mode")
(depends-on "scala-mode2")
(depends-on "scss-mode")
(depends-on "slim-mode")
(depends-on "go-mode")
(depends-on "rust-mode")
(depends-on "elixir-mode")
......
......@@ -55,6 +55,7 @@ Features
- Sass
- Scala
- SCSS
- Slim
- Shell scripts (POSIX Shell, Bash and Zsh)
- TeX/LaTeX
- XML
......
......@@ -228,6 +228,8 @@ SCSS
Shell scripts (using Bash, Dash, or Zsh depending on the type of shell
script)
@item
Slim
@item
TeX/LaTeX (using @command{chktex} or @command{lacheck})
@item
XML (using @command{xmlstarlet} or @command{xmllint})
......@@ -3153,6 +3155,7 @@ order of their appearance in the default value of
@iflyc scss
@iflyc sh-dash
@iflyc sh-bash
@iflyc slim
@iflyc tex-chktex
@iflyc tex-lacheck
@iflyc xml-xmlstarlet
......
......@@ -154,6 +154,7 @@ buffer-local wherever it is set."
scss
sh-dash
sh-bash
slim
tex-chktex
tex-lacheck
xml-xmlstarlet
......@@ -4258,6 +4259,18 @@ See URL `http://www.gnu.org/software/bash/'."
:modes sh-mode
:predicate (lambda () (eq sh-shell 'sh)))
(flycheck-define-checker slim
"A Slim syntax checker using the Slim compiler.
See URL `http://slim-lang.com'."
:command ("slimrb" "-c" source)
:error-patterns
((error line-start
"Slim::Parser::SyntaxError:" (message) (optional "\r") "\n "
(file-name) ", Line " line (optional ", Column " column)
line-end))
:modes slim-mode)
(flycheck-def-config-file-var flycheck-chktexrc tex-chktex ".chktexrc"
:safe #'stringp)
......
......@@ -10,6 +10,7 @@ class flycheck::checkers::gems {
'puppet-lint',
'rubocop', # ruby-rubocop
'sass', # sass/scss
'slim', # slim
]
package { $gem_packages:
......
......@@ -52,6 +52,7 @@
sass-mode
scala-mode2
scss-mode
slim-mode
yaml-mode)
(require it))
......@@ -855,6 +856,15 @@ See URL `https://github.com/flycheck/flycheck/issues/45' and URL
"checkers/sh-dash-syntax-error.sh" 'sh-mode '(sh-bash)
'(5 nil "Syntax error: \"fi\" unexpected (expecting \"then\")" error))))
(ert-deftest checker-slim-error ()
(flycheck-testsuite-fail-unless-checker 'slim)
(let* ((slim-version (cadr (split-string (car (process-lines "slimrb" "-v")))))
(expected-error (if (version<= "1.3.1" slim-version)
'(2 1 "Unexpected indentation" error)
'(2 nil "Unexpected indentation" error))))
(flycheck-testsuite-should-syntax-check
"checkers/slim-error.slim" 'slim-mode nil expected-error)))
(ert-deftest checker-tex-chktex-warning ()
:expected-result (flycheck-testsuite-fail-unless-checker 'tex-chktex)
(flycheck-testsuite-should-syntax-check
......
doctype html
html
head
title Slim Examples
body
h1 Markup examples
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