Commit 3800bb69 authored by Manuel Uberti's avatar Manuel Uberti Committed by Sebastian Wiesner

Add syntax checker for CHICKEN Scheme (#987)

parent 5ba9fd9c
......@@ -4,6 +4,7 @@
- New syntax checkers:
- Slim with ``slim-lint`` [GH-1013]
- CHICKEN Scheme with ``csc`` [GH-987]
- New features:
......
......@@ -18,6 +18,7 @@
(depends-on "d-mode")
(depends-on "erlang")
(depends-on "ess")
(depends-on "geiser")
(depends-on "go-mode")
(depends-on "groovy-mode")
(depends-on "haml-mode")
......
......@@ -159,6 +159,7 @@ to Flycheck:
* Lorenzo Villani (:gh:`lvillani`)
* Magnar Sveen (:gh:`magnars`)
* Malyshev Artem (:gh:`proofit404`)
* Manuel Uberti (:gh:`manuel-uberti`)
* Marcin Antczak (:gh:`marcinant`)
* Marcus Majewski (:gh:`hekto`)
* Marian Schubert (:gh:`maio`)
......
......@@ -908,6 +908,20 @@ to view the docstring of the syntax checker. Likewise, you may use
`flycheck-scalastylerc` is not set or the configuration file not found
this syntax checker will not be applied.
.. supported-language:: Scheme
Flycheck checks CHICKEN Scheme files with ``csc``.
.. syntax-checker:: scheme-chicken
Check syntax with ``csc``, the `CHICKEN Scheme <http://call-cc.org/>`_
compiler.
.. important::
`Geiser <http://www.nongnu.org/geiser/>` must be installed and active
for this checker to work.
.. supported-language:: SCSS
Flycheck checks SCSS with `scss-lint`, falling back to `scss`.
......
......@@ -233,6 +233,7 @@ attention to case differences."
sass
scala
scala-scalastyle
scheme-chicken
scss-lint
scss
sh-bash
......@@ -8427,6 +8428,32 @@ See URL `http://www.scalastyle.org'."
((not config-file) '(bold error))
(t 'success)))))))
(flycheck-define-checker scheme-chicken
"A CHICKEN Scheme syntax checker using the CHICKEN compiler `csc'.
See URL `http://call-cc.org/'."
:command ("csc" "-analyze-only" "-local" source)
:predicate
(lambda ()
;; In `scheme-mode' we must check the current Scheme implementation
;; being used
(and (boundp 'geiser-impl--implementation)
(eq geiser-impl--implementation 'chicken)))
:error-patterns
((info line-start
"Note: " (zero-or-more not-newline) ":\n"
(one-or-more (any space)) "(" (file-name) ":" line ") " (message)
line-end)
(warning line-start
"Warning: " (zero-or-more not-newline) ":\n"
(one-or-more (any space)) "(" (file-name) ":" line ") " (message)
line-end)
(error line-start
"Error: " (zero-or-more not-newline) ":\n"
(one-or-more (any space)) "(" (file-name) ":" line ") " (message)
line-end))
:modes (scheme-mode geiser-mode))
(defconst flycheck-scss-lint-checkstyle-re
(rx "cannot load such file" (1+ not-newline) "scss_lint_reporter_checkstyle")
"Regular expression to parse missing checkstyle error.")
......
......@@ -3888,6 +3888,19 @@ Why not:
'(5 9 warning "Redundant braces after class definition"
:checker scala-scalastyle))))
(flycheck-ert-def-checker-test scheme-chicken scheme nil
(let ((setup-geiser
(lambda ()
(setq-local geiser-scheme-implementation 'chicken)
(geiser-mode))))
(add-hook 'scheme-mode-hook setup-geiser)
(unwind-protect
(flycheck-ert-should-syntax-check
"language/chicken.scm" 'geiser-mode
'(2 nil warning "in procedure call to `g1', expected a value of type `(procedure (* *) *)' but was given a value of type `number'"
:checker scheme-chicken))
(remove-hook 'scheme-mode-hook setup-geiser))))
(flycheck-ert-def-checker-test scss-lint scss nil
(let ((flycheck-scss-lintrc "scss-lint.yml"))
(flycheck-ert-should-syntax-check
......
(define (round-1)
(round ((* 5.0 3.0) / 4.0)))
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