[PATCH] gnu: Add emacs-flymake-shellcheck.

  • Done
  • quality assurance status badge
Details
3 participants
  • Morgan Smith
  • LaFreniere, Joseph
  • Nicolas Goaziou
Owner
unassigned
Submitted by
LaFreniere, Joseph
Severity
normal
Merged with
L
L
LaFreniere, Joseph wrote on 4 Apr 2020 17:35
(address . guix-patches@gnu.org)
87o8s7p8lq.fsf@odyssey.lafreniere.xyz
Patch file is attached.

--
Joseph LaFreniere
From 53688eb572a104972eadd2d0d8568452e41b2f70 Mon Sep 17 00:00:00 2001
From: Joseph LaFreniere <joseph@lafreniere.xyz>
Date: Sat, 4 Apr 2020 09:50:56 -0500
Subject: [PATCH] gnu: Add emacs-flymake-shellcheck.

* gnu/packages/emacs-xyz.scm (emacs-flymake-shellcheck): New variable.
---
gnu/packages/emacs-xyz.scm | 38 ++++++++++++++++++++++++++++++++++++++
1 file changed, 38 insertions(+)

Toggle diff (58 lines)
diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index cd2562103c..eb62bc578b 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -163,6 +163,7 @@
#:use-module (gnu packages sqlite)
#:use-module (gnu packages gnupg)
#:use-module (gnu packages video)
+ #:use-module (gnu packages haskell-apps)
#:use-module (gnu packages haskell-xyz)
#:use-module (gnu packages wordnet)
#:use-module (gnu packages photo)
@@ -3548,6 +3549,43 @@ It also provides an easy way to find synonyms and antonyms for a given
word (to avoid repetitions for example).")
(license license:gpl3+)))
+(define-public emacs-flymake-shellcheck
+ (let ((version "0.1")
+ (revision "0")
+ (commit "bb413006afc23105a0f84df6fb82504a06483a55"))
+ (package
+ (name "emacs-flymake-shellcheck")
+ (version (git-version version revision commit))
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/federicotdn/flymake-shellcheck.git")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "09cqn0255pxim34v5zfypbzr4clfd2ajlsyxpc9h64wg6v9876y5"))))
+ (build-system emacs-build-system)
+ (inputs
+ `(("shellcheck" ,shellcheck)))
+ (arguments
+ '(#:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'hardcode-shellcheck-path
+ (lambda _
+ (let ((file "flymake-shellcheck.el"))
+ (chmod file #o644)
+ (emacs-substitute-sexps file
+ ("(defcustom flymake-shellcheck-path"
+ (which "shellcheck")))))))))
+ (home-page "https://github.com/federicotdn/flymake-shellcheck")
+ (synopsis "A bash/sh Flymake backend powered by ShellCheck")
+ (description
+ "This package adds a @code{shellcheck} backend to Flymake. The
+recommended usage is to add @code{flymake-shellcheck-load} to
+@code{sh-mode-hook}.")
+ (license license:gpl3+))))
+
(define-public emacs-flycheck-rust
(package
(name "emacs-flycheck-rust")
--
2.26.0
N
N
Nicolas Goaziou wrote on 5 Apr 2020 10:11
(name . LaFreniere, Joseph)(address . joseph@lafreniere.xyz)(address . 40429@debbugs.gnu.org)
875zeecpxe.fsf@nicolasgoaziou.fr
Hello,

"LaFreniere, Joseph" <joseph@lafreniere.xyz> writes:

Toggle quote (2 lines)
> Patch file is attached.

Thank you.

Toggle quote (13 lines)
> + (inputs
> + `(("shellcheck" ,shellcheck)))
> + (arguments
> + '(#:phases
> + (modify-phases %standard-phases
> + (add-after 'unpack 'hardcode-shellcheck-path
> + (lambda _
> + (let ((file "flymake-shellcheck.el"))
> + (chmod file #o644)
> + (emacs-substitute-sexps file
> + ("(defcustom flymake-shellcheck-path"
> + (which "shellcheck")))))))))

You could use `emacs-substitute-variables' here.

However, I wonder if we should add "shellcheck" as an input. Of course,
the package will not work so well if "shellcheck" is not available. But,
as a user, it would not cross my mind to use "flymake-shellcheck"
without it. As another data point, "emacs-flycheck-rust" doesn't add
"rust" as an input.

WDYT?

Regards,

--
Nicolas Goaziou
M
M
Morgan Smith wrote on 24 Oct 2021 00:24
control message for bug #51364
(address . control@debbugs.gnu.org)
BYAPR05MB402399E321163C00123A6E96C5819@BYAPR05MB4023.namprd05.prod.outlook.com
merge 51364 40429
quit
?