GNU bug report logs - #51364
[PATCH] gnu: emacs-flymake-shellcheck: Add shellcheck as an input

Previous Next

Package: guix-patches;

Reported by: Morgan.J.Smith <at> outlook.com

Date: Sat, 23 Oct 2021 22:22:02 UTC

Severity: normal

Tags: patch

Merged with 40429

Done: Efraim Flashner <efraim <at> flashner.co.il>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 51364 in the body.
You can then email your comments to 51364 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#51364; Package guix-patches. (Sat, 23 Oct 2021 22:22:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Morgan.J.Smith <at> outlook.com:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Sat, 23 Oct 2021 22:22:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Morgan.J.Smith <at> outlook.com
To: guix-patches <at> gnu.org
Cc: Morgan Smith <Morgan.J.Smith <at> outlook.com>
Subject: [PATCH] gnu: emacs-flymake-shellcheck: Add shellcheck as an input
Date: Sat, 23 Oct 2021 18:21:28 -0400
From: Morgan Smith <Morgan.J.Smith <at> outlook.com>

* gnu/packages/emacs-xyz.scm (emacs-flymake-shellcheck)
[inputs]: Add shellcheck.
[arguments]: Add substitute-shellcheck-path phase.
---
 gnu/packages/emacs-xyz.scm | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index aeb6aa4aba..602e6067a4 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -1649,6 +1649,18 @@ (define-public emacs-flymake-shellcheck
          (sha256
           (base32 "04yfb4sy41spjzk9mhm4gy0h8vnjx09p2g6nm1yzgd9a5ph9sqgl"))))
       (build-system emacs-build-system)
+      (arguments
+       '(#:phases
+         (modify-phases %standard-phases
+           (add-after 'unpack 'substitute-shellcheck-path
+             (lambda* (#:key inputs #:allow-other-keys)
+               (chmod "flymake-shellcheck.el" #o644)
+               (emacs-substitute-variables "flymake-shellcheck.el"
+                 ("flymake-shellcheck-path"
+                  (string-append (assoc-ref inputs "shellcheck")
+                                 "/bin/shellcheck"))))))))
+      (inputs
+       `(("shellcheck" ,shellcheck)))
       (home-page "https://github.com/federicotdn/flymake-shellcheck")
       (synopsis "Flymake backend for Bash/Sh powered by ShellCheck")
       (description
-- 
2.33.1





Merged 40429 51364. Request was from Morgan Smith <Morgan.J.Smith <at> outlook.com> to control <at> debbugs.gnu.org. (Sat, 23 Oct 2021 22:25:01 GMT) Full text and rfc822 format available.

Information forwarded to guix-patches <at> gnu.org:
bug#51364; Package guix-patches. (Mon, 25 Oct 2021 11:41:01 GMT) Full text and rfc822 format available.

Message #10 received at 51364 <at> debbugs.gnu.org (full text, mbox):

From: Efraim Flashner <efraim <at> flashner.co.il>
To: Morgan.J.Smith <at> outlook.com
Cc: 51364 <at> debbugs.gnu.org
Subject: Re: [bug#51364] [PATCH] gnu: emacs-flymake-shellcheck: Add
 shellcheck as an input
Date: Mon, 25 Oct 2021 14:39:40 +0300
[Message part 1 (text/plain, inline)]
On Sat, Oct 23, 2021 at 06:21:28PM -0400, Morgan.J.Smith <at> outlook.com wrote:
> From: Morgan Smith <Morgan.J.Smith <at> outlook.com>
> 
> * gnu/packages/emacs-xyz.scm (emacs-flymake-shellcheck)
> [inputs]: Add shellcheck.
> [arguments]: Add substitute-shellcheck-path phase.
> ---
>  gnu/packages/emacs-xyz.scm | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
> index aeb6aa4aba..602e6067a4 100644
> --- a/gnu/packages/emacs-xyz.scm
> +++ b/gnu/packages/emacs-xyz.scm
> @@ -1649,6 +1649,18 @@ (define-public emacs-flymake-shellcheck
>           (sha256
>            (base32 "04yfb4sy41spjzk9mhm4gy0h8vnjx09p2g6nm1yzgd9a5ph9sqgl"))))
>        (build-system emacs-build-system)
> +      (arguments
> +       '(#:phases
> +         (modify-phases %standard-phases
> +           (add-after 'unpack 'substitute-shellcheck-path
> +             (lambda* (#:key inputs #:allow-other-keys)
> +               (chmod "flymake-shellcheck.el" #o644)

This line I'd change to
(make-file-writable "flymake-shellcheck.el")

> +               (emacs-substitute-variables "flymake-shellcheck.el"
> +                 ("flymake-shellcheck-path"
> +                  (string-append (assoc-ref inputs "shellcheck")
> +                                 "/bin/shellcheck"))))))))
> +      (inputs
> +       `(("shellcheck" ,shellcheck)))
>        (home-page "https://github.com/federicotdn/flymake-shellcheck")
>        (synopsis "Flymake backend for Bash/Sh powered by ShellCheck")
>        (description
> -- 
> 2.33.1
> 

I'm not sure about hardcoding the path to shellcheck and removing the
option to override it in the normal way of the file, by setting
flymake-shellcheck-path¹. I am not sure of the exact return value of
(executable-find "shellcheck") but it seems safer to replace that.

Can you send an updated patch?

¹ I assume, I don't actually use emacs

-- 
Efraim Flashner   <efraim <at> flashner.co.il>   רנשלפ םירפא
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#51364; Package guix-patches. (Tue, 02 Nov 2021 23:25:01 GMT) Full text and rfc822 format available.

Message #13 received at 51364 <at> debbugs.gnu.org (full text, mbox):

From: Morgan.J.Smith <at> outlook.com
To: 51364 <at> debbugs.gnu.org
Cc: Morgan Smith <Morgan.J.Smith <at> outlook.com>
Subject: [PATCH] gnu: emacs-flymake-shellcheck: Add shellcheck as an input
Date: Tue,  2 Nov 2021 19:23:50 -0400
From: Morgan Smith <Morgan.J.Smith <at> outlook.com>

* gnu/packages/emacs-xyz.scm (emacs-flymake-shellcheck)
[inputs]: Add shellcheck.
[arguments]: Add substitute-shellcheck-path phase.
---

Sorry for the late reply, I didn't see this in my email.

People would still have been able to set the variable from their configuration.
The value I'm editing just determines the default value.  However, I think I
came up with a nice solution that should make everyone happy.  It first checks
if there is shellcheck in your path and only hard codes the path if you don't
have it.  Apparently Emacs even re-evaluates defcustoms in certain situations
so this *might* even work if someone installs shellcheck after this file has
been loaded.

 gnu/packages/emacs-xyz.scm | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index 624fe957e3..dad555cae3 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -1649,6 +1649,19 @@ (define-public emacs-flymake-shellcheck
          (sha256
           (base32 "04yfb4sy41spjzk9mhm4gy0h8vnjx09p2g6nm1yzgd9a5ph9sqgl"))))
       (build-system emacs-build-system)
+      (arguments
+       '(#:phases
+         (modify-phases %standard-phases
+           (add-after 'unpack 'substitute-shellcheck-path
+             (lambda* (#:key inputs #:allow-other-keys)
+               (make-file-writable "flymake-shellcheck.el")
+               (emacs-substitute-sexps "flymake-shellcheck.el"
+                 ("defcustom flymake-shellcheck-path"
+                  `(or (executable-find "shellcheck")
+                       ,(string-append (assoc-ref inputs "shellcheck")
+                                       "/bin/shellcheck")))))))))
+      (inputs
+       `(("shellcheck" ,shellcheck)))
       (home-page "https://github.com/federicotdn/flymake-shellcheck")
       (synopsis "Flymake backend for Bash/Sh powered by ShellCheck")
       (description
-- 
2.33.1





Reply sent to Efraim Flashner <efraim <at> flashner.co.il>:
You have taken responsibility. (Thu, 04 Nov 2021 13:06:01 GMT) Full text and rfc822 format available.

Notification sent to Morgan.J.Smith <at> outlook.com:
bug acknowledged by developer. (Thu, 04 Nov 2021 13:06:02 GMT) Full text and rfc822 format available.

Message #18 received at 51364-done <at> debbugs.gnu.org (full text, mbox):

From: Efraim Flashner <efraim <at> flashner.co.il>
To: 51364-done <at> debbugs.gnu.org
Subject: Re: [PATCH v2] gnu: emacs-flymake-shellcheck: Add shellcheck as an
 input
Date: Thu, 4 Nov 2021 15:05:19 +0200
[Message part 1 (text/plain, inline)]
On Tue, Nov 02, 2021 at 07:13:10PM -0400, Morgan.J.Smith <at> outlook.com wrote:
> From: Morgan Smith <Morgan.J.Smith <at> outlook.com>
> 
> * gnu/packages/emacs-xyz.scm (emacs-flymake-shellcheck)
> [inputs]: Add shellcheck.
> [arguments]: Add substitute-shellcheck-path phase.
> ---
> 
> Sorry for the late reply, I didn't see this in my email.
> 
> People would still have been able to set the variable from their configuration.  The value I'm editing just determines the default value.  However, I think I came up with a nice solution that should make everyone happy.  It first checks if there is shellcheck in your path and only hard codes the path if you don't have it.  Apparently Emacs even re-evaluates defcustoms in certain situations so this *might* even work if someone installs shellcheck after this file has been loaded.

Looks good to me. Patch pushed.

You also might've missed the email because my self-hosted email server
sometimes gets blocked. I've added you to X-Debbugs-CC so you should get
this email directly.

-- 
Efraim Flashner   <efraim <at> flashner.co.il>   רנשלפ םירפא
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
[signature.asc (application/pgp-signature, inline)]

Reply sent to Efraim Flashner <efraim <at> flashner.co.il>:
You have taken responsibility. (Thu, 04 Nov 2021 13:06:02 GMT) Full text and rfc822 format available.

Notification sent to "LaFreniere, Joseph" <joseph <at> lafreniere.xyz>:
bug acknowledged by developer. (Thu, 04 Nov 2021 13:06:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 03 Dec 2021 12:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 144 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.