Commit d4c302c0 authored by William Cummings's avatar William Cummings Committed by Sebastian Wiesner

Add new racket checker

Closes GH-799 and closes GH-873
parent 5e0d9485
......@@ -64,6 +64,7 @@ substantial code to Flycheck:
* [Tomoya Tanjo](https://github.com/tom-tan)
* [Victor Deryagin](https://github.com/vderyagin)
* [Vlatko Basic](https://github.com/vlatkoB)
* [William Cummings](https://github.com/wcummings)
* [William Xu](https://github.com/xwl)
* [Yannick Roehlly](https://github.com/yannick1974)
* [Yasuyuki Oka](https://github.com/yasuyk)
......
......@@ -21,6 +21,7 @@ now for questions and discussions about development. [GH-820]
* New syntax checkers:
* Processing [GH-793] [GH-812]
* Racket [GH-799] [GH-873]
* New features:
......
......@@ -33,6 +33,7 @@
(depends-on "php-mode")
(depends-on "processing-mode")
(depends-on "puppet-mode")
(depends-on "racket-mode")
(depends-on "rhtml-mode")
(depends-on "rpm-spec-mode")
(depends-on "rust-mode")
......
......@@ -30,6 +30,7 @@
@item @ref{Puppet}
@item @ref{Python}
@item @ref{R}
@item @ref{Racket}
@item @ref{RPM Spec}
@item @ref{reStructuredText}
@item @ref{Ruby}
......
......@@ -629,6 +629,14 @@ selects the linters to use.
@end itemize
@flyclanguage{Racket}
@itemize
@item
@flyc{racket} (syntax checker with @code{raco expand}, requires the
@code{compiler-lib} package)
@end itemize
@flyclanguage{RPM Spec}
@itemize
......
......@@ -224,6 +224,7 @@ attention to case differences."
python-pylint
python-pycompile
r-lintr
racket
rpm-rpmlint
rst-sphinx
rst
......@@ -7669,6 +7670,30 @@ See URL `https://github.com/jimhester/lintr'."
;; Don't check ESS files which do not contain R
:predicate (lambda () (equal ess-language "S")))
(flycheck-define-checker racket
"A Racket syntax checker with `raco expand'.
The `compiler-lib' racket package is required for this syntax
checker.
See URL `https://racket-lang.org/'."
:command ("raco" "expand" source-inplace)
:predicate
(lambda ()
(let ((raco (flycheck-checker-executable 'racket)))
(with-temp-buffer
(call-process raco nil t nil "expand")
(goto-char (point-min))
(not (looking-at-p (rx bol (1+ not-newline)
"Unrecognized command: expand"
eol))))))
:error-filter
(lambda (errors)
(flycheck-sanitize-errors (flycheck-increment-error-columns errors)))
:error-patterns
((error line-start (file-name) ":" line ":" column ":" (message) line-end))
:modes racket-mode)
(flycheck-define-checker rpm-rpmlint
"A RPM SPEC file syntax checker using rpmlint.
......
......@@ -4020,6 +4020,12 @@ Why not:
'(4 6 warning "Do not use absolute paths." :checker r-lintr)
'(7 5 error "unexpected end of input" :checker r-lintr))))
(flycheck-ert-def-checker-test racket racket nil
(skip-unless (funcall (flycheck-checker-get 'racket 'predicate)))
(flycheck-ert-should-syntax-check
"language/racket.rkt" 'racket-mode
'(4 3 error "read: expected a `)' to close `('" :checker racket)))
(flycheck-ert-def-checker-test rpm-rpmlint rpm nil
(flycheck-ert-should-syntax-check
"language/rpm.spec" '(sh-mode rpm-spec-mode)
......
(define listener (tcp-listen 12345))
(let echo-server ()
(define-values (in out) (tcp-accept listener))
(thread (lambda () (copy-port in out)
(close-output-port out))
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