Commit 358c0750 authored by Yasuyuki Oka's avatar Yasuyuki Oka

Add syntax checker for AsciiDoc using AsciiDoc compiler

parent d62271b4
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
(depends-on "projectile") ; Projectile integration (depends-on "projectile") ; Projectile integration
;; Various modes for use in the unit tests ;; Various modes for use in the unit tests
(depends-on "adoc-mode")
(depends-on "coffee-mode") (depends-on "coffee-mode")
(depends-on "haml-mode") (depends-on "haml-mode")
(depends-on "handlebars-mode") (depends-on "handlebars-mode")
......
...@@ -174,6 +174,8 @@ Built-in syntax checkers for: ...@@ -174,6 +174,8 @@ Built-in syntax checkers for:
@itemize @bullet @itemize @bullet
@item @item
AsciiDoc
@item
C/C++ (using @command{clang} and @command{cppcheck}) C/C++ (using @command{clang} and @command{cppcheck})
@item @item
CoffeeScript (using @command{coffee} and @command{coffeelint}) CoffeeScript (using @command{coffee} and @command{coffeelint})
...@@ -3323,6 +3325,7 @@ order of their appearance in the default value of ...@@ -3323,6 +3325,7 @@ order of their appearance in the default value of
@code{flycheck-checkers}: @code{flycheck-checkers}:
@itemize @bullet @itemize @bullet
@iflyc asciidoc
@iflyc bash @iflyc bash
@iflyc c/c++-clang @iflyc c/c++-clang
@iflyc c/c++-cppcheck @iflyc c/c++-cppcheck
......
...@@ -118,7 +118,8 @@ buffer-local wherever it is set." ...@@ -118,7 +118,8 @@ buffer-local wherever it is set."
:link '(info-link "(flycheck)Configuration")) :link '(info-link "(flycheck)Configuration"))
(defcustom flycheck-checkers (defcustom flycheck-checkers
'(bash '(asciidoc
bash
c/c++-clang c/c++-clang
c/c++-cppcheck c/c++-cppcheck
coffee coffee
...@@ -3288,6 +3289,18 @@ variable symbol for a syntax checker." ...@@ -3288,6 +3289,18 @@ variable symbol for a syntax checker."
;;;; Built-in checkers ;;;; Built-in checkers
(flycheck-define-checker asciidoc
"A AsciiDoc syntax checker using the AsciiDoc compiler.
See URL `http://www.methods.co.nz/asciidoc'."
:command ("asciidoc" source)
:error-patterns
((error line-start "asciidoc: ERROR: " (file-name)
": Line " line ": " (message) line-end)
(warning line-start "asciidoc: " (or "WARNING" "DEPRECATED") ": " (file-name)
": Line " line ": " (message) line-end))
:modes adoc-mode)
(flycheck-define-checker bash (flycheck-define-checker bash
"A Bash syntax checker using the Bash shell. "A Bash syntax checker using the Bash shell.
......
...@@ -78,7 +78,8 @@ class flycheck::checkers { ...@@ -78,7 +78,8 @@ class flycheck::checkers {
require => Class['flycheck::python'], require => Class['flycheck::python'],
} }
$packages = [ 'bash', # bash/sh-bash $packages = [ 'asciidoc', # asciidoc
'bash', # bash/sh-bash
'cppcheck', # c/c++-cpppcheck 'cppcheck', # c/c++-cpppcheck
'ghc', # haskell-ghc 'ghc', # haskell-ghc
'hlint', # haskell-lint 'hlint', # haskell-lint
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
;; Load all modes used by our tests ;; Load all modes used by our tests
(--each '(sh-script (--each '(sh-script
adoc-mode
cc-mode cc-mode
coffee-mode coffee-mode
css-mode css-mode
...@@ -64,6 +65,14 @@ ...@@ -64,6 +65,14 @@
(require 'sh-script) ; For `sh-set-shell' (require 'sh-script) ; For `sh-set-shell'
(ert-deftest builtin-checker/asciidoc ()
:expected-result (flycheck-testsuite-fail-unless-checker 'asciidoc)
(flycheck-testsuite-should-syntax-check
"checkers/asciidoc.adoc" 'adoc-mode
'(1 nil warning "missing style: [paradef-default]: paragraph" :checker asciidoc)
'(3 nil warning "old tables syntax" :checker asciidoc)
'(11 nil error "[tabledef-default] illegal width=%60%" :checker asciidoc)))
(ert-deftest builtin-checker/bash-missing-semicolon () (ert-deftest builtin-checker/bash-missing-semicolon ()
"Test a syntax error from a missing semicolon." "Test a syntax error from a missing semicolon."
:expected-result (flycheck-testsuite-fail-unless-checker 'bash) :expected-result (flycheck-testsuite-fail-unless-checker 'bash)
......
[paragraph]
{empty}
`---`---
1 2
3 4
5 6
--------
[format="csv", width="%60%", cols="4"]
|======
1,2,3,4
a,b,c,d
A,B,C,D
|======
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