Use upstream flycheck-guile package

This commit is contained in:
Andrew Whatson 2020-06-11 13:16:33 +10:00
parent f7431aa7c9
commit 9a8710f87e
3 changed files with 9 additions and 74 deletions

View file

@ -1,71 +0,0 @@
;;; flycheck-guile --- Checker for guile using guild -*- lexical-binding: t; -*-
;; NOTE: This checker was initially borrowed from guile-studio:
;; https://git.elephly.net/software/guile-studio.git
(defvar flycheck-guile-warnings
'(;"unsupported-warning" ; warn about unknown warning types
"unused-variable" ; report unused variables
"unused-toplevel" ; report unused local top-level variables
;"shadowed-toplevel" ; report shadowed top-level variables
"unbound-variable" ; report possibly unbound variables
"macro-use-before-definition" ; report possibly mis-use of macros before they are defined
"arity-mismatch" ; report procedure arity mismatches (wrong number of arguments)
"duplicate-case-datum" ; report a duplicate datum in a case expression
"bad-case-datum" ; report a case datum that cannot be meaningfully compared using `eqv?'
"format" ; report wrong number of arguments to `format'
)
"A list of warnings to enable for `guild compile'.
The value of this variable is a list of strings, where each string names a
supported warning type.
The list of supported warning types can be found by running
`guild compile -W help'.")
(flycheck-define-checker guile
"A Guile syntax checker using `guild compile'."
:command ("guild" "compile" "--to=cps"
(option-list "-W" flycheck-guile-warnings)
(option-list "-L" geiser-guile-load-path list expand-file-name)
source)
:predicate
(lambda ()
(and (boundp 'geiser-impl--implementation)
(eq geiser-impl--implementation 'guile)))
:verify
(lambda (checker)
(let ((geiser-impl (bound-and-true-p geiser-impl--implementation)))
(list
(flycheck-verification-result-new
:label "Geiser Implementation"
:message (cond
((eq geiser-impl 'guile) "Guile")
(geiser-impl (format "Other: %s" geiser-impl))
(t "Geiser not active"))
:face (cond
((or (eq geiser-impl 'guile)) 'success)
(t '(bold error)))))))
:error-patterns
((warning
line-start
(file-name) ":" line ":" column ": warning:" (message) line-end)
(error
line-start
"ice-9/boot-9.scm:" (+ digit) ":" (+ digit) ":" (+ (any space "\n"))
"In procedure raise-exception:" (+ (any space "\n"))
"In procedure " (id (+ (not ":"))) ":" (+ (any space "\n"))
(file-name) ":" line ":" column ":" (message (+? anything)) (* space) string-end)
(error
line-start
"ice-9/boot-9.scm:" (+ digit) ":" (+ digit) ":" (+ (any space "\n"))
"In procedure raise-exception:" (+ (any space "\n"))
(id (+ (not ":"))) ":" (+ (any space "\n"))
(file-name) ":" line ":" column ":" (message (+? anything)) (* space) string-end)
(error
line-start
(file-name) ":" line ":" column ":" (message (+? anything)) (* space) string-end)
)
:modes (scheme-mode geiser-mode))
(add-to-list 'flycheck-checkers 'guile)

View file

@ -19,9 +19,6 @@
(set-lookup-handlers! 'scheme-mode (set-lookup-handlers! 'scheme-mode
:definition #'geiser-edit-symbol-at-point :definition #'geiser-edit-symbol-at-point
:documentation #'geiser-doc-symbol-at-point)) :documentation #'geiser-doc-symbol-at-point))
(when (featurep! :checkers syntax)
(after! flycheck
(load! "autoload/flycheck-guile")))
:config :config
(set-popup-rules! (set-popup-rules!
'(("^\\*geiser messages\\*$" :slot 1 :vslot -1) '(("^\\*geiser messages\\*$" :slot 1 :vslot -1)
@ -60,3 +57,7 @@
"r" #'geiser-restart-repl "r" #'geiser-restart-repl
"R" #'geiser-reload "R" #'geiser-reload
"c" #'geiser-repl-clear-buffer))) "c" #'geiser-repl-clear-buffer)))
(use-package! flycheck-guile
:when (featurep! :checkers syntax)
:after geiser)

View file

@ -2,3 +2,8 @@
;;; lang/scheme/packages.el ;;; lang/scheme/packages.el
(package! geiser :pin "0c86289d7b2af07e3653364219e00103c8540edf") (package! geiser :pin "0c86289d7b2af07e3653364219e00103c8540edf")
(when (featurep! :checkers syntax)
(package! flycheck-guile
:recipe (:host github :repo "flatwhatson/flycheck-guile")
:pin "f37b6143776d15b3e7907e7621f6f96f8b1aec48"))