diff mbox series

[bug#40429] gnu: Add emacs-flymake-shellcheck.

Message ID 87o8s7p8lq.fsf@odyssey.lafreniere.xyz
State Under Review
Headers show
Series [bug#40429] gnu: Add emacs-flymake-shellcheck. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch fail View Laminar job

Commit Message

Joseph LaFreniere April 4, 2020, 3:35 p.m. UTC
Patch file is attached.

--
Joseph LaFreniere

Comments

Nicolas Goaziou April 5, 2020, 8:11 a.m. UTC | #1
Hello,

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

> Patch file is attached.

Thank you.

> +      (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,
diff mbox series

Patch

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(+)

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