[PATCH 0/3] Add shfmt.

  • Done
  • quality assurance status badge
Details
2 participants
  • Brian Kubisiak
  • Sharlatan Hellseher
Owner
unassigned
Submitted by
Brian Kubisiak
Severity
normal
B
B
Brian Kubisiak wrote on 5 Aug 23:56 +0200
(address . guix-patches@gnu.org)
cover.1722894774.git.brian@kubisiak.com
This patch series adds shfmt, which is a CLI tool for formatting bash and
POSIX sh code.

Brian Kubisiak (3):
gnu: Add go-github-com-google-renameio-v2.
gnu: Add go-mvdan-cc-editorconfig.
gnu: Add shfmt.

gnu/packages/golang.scm | 91 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 91 insertions(+)


base-commit: 8006d74ce6dbe74806d14e74e3f32e7a5c92811a
--
2.45.2
B
B
Brian Kubisiak wrote on 6 Aug 01:04 +0200
[PATCH 1/3] gnu: Add go-github-com-google-renameio-v2.
(address . 72482@debbugs.gnu.org)
c168d0406a73a999853d0595512c6e4906c2a7f7.1722894774.git.brian@kubisiak.com
* gnu/packages/golang.scm (go-github-com-google-renameio-v2): New
variable.

Change-Id: Iaeabf95d21d22b25df5f8caf1edcaaddee3d3965
---
gnu/packages/golang.scm | 17 +++++++++++++++++
1 file changed, 17 insertions(+)

Toggle diff (28 lines)
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 1298a8c58b..46932b01ef 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -6107,6 +6107,23 @@ (define-public go-github-com-google-renameio
create or replace a file or symbolic link.")
(license license:asl2.0)))

+(define-public go-github-com-google-renameio-v2
+ (package/inherit go-github-com-google-renameio
+ (name "go-github-com-google-renameio-v2")
+ (version "2.0.0")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/google/renameio")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "13vc7p43zz5pmgli4k18b15khxpca1zd8v1ga0ryq7ddyz55fg7i"))))
+ (arguments
+ (list
+ #:import-path "github.com/google/renameio/v2"))))
+
(define (go-gotest-tools-source version sha256-base32-hash)
(origin
(method git-fetch)
--
2.45.2
B
B
Brian Kubisiak wrote on 6 Aug 01:05 +0200
[PATCH 2/3] gnu: Add go-mvdan-cc-editorconfig.
(address . 72482@debbugs.gnu.org)
84dea6043a863d8e8a11524fb11e6d26d4abcca3.1722894774.git.brian@kubisiak.com
* gnu/packages/golang.scm (go-mvdan-cc-editorconfig): New variable.

Change-Id: I4cc558e0b7be7d66ad2919eac49c355532052bb9
---
gnu/packages/golang.scm | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)

Toggle diff (44 lines)
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 46932b01ef..63308d1af7 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -79,6 +79,7 @@ (define-module (gnu packages golang)
#:use-module (gnu packages base)
#:use-module ((gnu packages bootstrap) #:select (glibc-dynamic-linker))
#:use-module (gnu packages check)
+ #:use-module (gnu packages cmake)
#:use-module (gnu packages fonts)
#:use-module (gnu packages gcc)
#:use-module (gnu packages glib)
@@ -8013,6 +8014,31 @@ (define-public go-git-sr-ht-adnano-go-gemini
Gemini clients and servers.")
(license license:expat)))

+(define-public go-mvdan-cc-editorconfig
+ (package
+ (name "go-mvdan-cc-editorconfig")
+ (version "0.3.0")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/mvdan/editorconfig")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0mi1cp6fyaknjn7smvaas4lj03fws5qib5vbi4mrz3qrmvmhh9l4"))))
+ (build-system go-build-system)
+ (arguments
+ (list
+ #:import-path "mvdan.cc/editorconfig"))
+ (native-inputs (list cmake))
+ (home-page "https://github.com/mvdan/editorconfig")
+ (synopsis "EditorConfig support in Go")
+ (description
+ "Package editorconfig allows parsing and using @code{EditorConfig} files, as
+defined in @url{https://editorconfig.org/,https://editorconfig.org/}.")
+ (license license:bsd-3)))
+
(define-public gofumpt
(package
(name "gofumpt")
--
2.45.2
B
B
Brian Kubisiak wrote on 6 Aug 01:05 +0200
[PATCH 3/3] gnu: Add shfmt.
(address . 72482@debbugs.gnu.org)
a77b8bd9acc73e22e56fecb09714779d931fe660.1722894774.git.brian@kubisiak.com
* gnu/packages/golang.scm (shfmt): New variable.

Change-Id: I7c8bcb0f0a1d0c45d5f8f2274724188a435f0cd7
---
gnu/packages/golang.scm | 48 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 48 insertions(+)

Toggle diff (59 lines)
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 63308d1af7..cf8e482bee 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -8120,6 +8120,54 @@ (define-public go-mvdan-cc-gofumpt
(native-inputs '())
(inputs '())))

+(define-public shfmt
+ (package
+ (name "shfmt")
+ (version "3.8.0")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/mvdan/sh")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "13anc64m088plwazrx5c68m3nbnig7wxa92zqk83w83q16dx42fq"))
+ (modules '((guix build utils)))
+ (snippet #~(let ((fixed-version (string-append #$version " (GNU Guix)")))
+ ;; shfmt uses modules to look up the version at runtime;
+ ;; since our build system does not yet support modules,
+ ;; inject the version string here instead
+ (substitute* "cmd/shfmt/main.go"
+ (("version = \"\\(devel\\)\"")
+ (format #f "version = \"~a\"" fixed-version)))
+ (substitute* "cmd/shfmt/testdata/script/flags.txtar"
+ (("devel\\|v3")
+ #$version))))))
+ (build-system go-build-system)
+ (arguments
+ (list
+ #:import-path "mvdan.cc/sh/v3/cmd/shfmt"
+ #:unpack-path "mvdan.cc/sh/v3"))
+ (inputs (list go-mvdan-cc-editorconfig
+ go-golang-org-x-term
+ go-golang-org-x-sys
+ go-golang-org-x-sync
+ go-github-com-rogpeppe-go-internal
+ go-github-com-pkg-diff
+ go-github-com-google-renameio-v2
+ go-github-com-google-go-cmp-cmp
+ go-github-com-frankban-quicktest
+ go-github-com-creack-pty))
+ (home-page "https://github.com/mvdan/sh")
+ (synopsis "Shell formatter with bash support")
+ (description
+ "This package provides a shell formatter. Supports
+@url{https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html,POSIX
+Shell}, @url{https://www.gnu.org/software/bash/,Bash}, and
+@url{http://www.mirbsd.org/mksh.htm,mksh}.")
+ (license license:bsd-3)))
+
(define-public unparam
(package
(name "unparam")
--
2.45.2
S
S
Sharlatan Hellseher wrote on 23 Aug 19:42 +0200
[PATCH 0/3] Add shfmt.
(address . 72482-done@debbugs.gnu.org)
87r0afb0gn.fsf@gmail.com
Hi,

Thank you for the patches.

I've reviewed, applied some modifications and pushed as
aa57dc8b31..064a6e1f90 to master.

- patches [3/3]
- [X] [PATCH 1/3] gnu: Add go-github-com-google-renameio-v2.
- [X] [PATCH 2/3] gnu: Add go-mvdan-cc-editorconfig.
- Place to golang-xyz
- [X] [PATCH 3/3] gnu: Add shfmt.
- Place to shellutils
- Move snippet to the phase instead
- Refresh to 3.9.0

--
Oleg
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEmEeB3micIcJkGAhndtcnv/Ys0rUFAmbIyegACgkQdtcnv/Ys
0rW2wxAAsu09T953tNiLYsKIJcznrFjxYyUL8jvIwhoWywgf9Vyh9WOYzawHP4ND
x4acSkxcn7Y6h5ZAzZ11QPL4iYfoIyuvk5KkDphbJHiqtEAfy/EUT0OuZ9HGybAj
zQzqilnfIhl17/7bbKpA5Ex8Aap6obxEU1kps9AQTuISD/D7TfFCn/o9c0DqDM+A
/mckzbzgf+hXKWAvJiQYOh3PVRV2gz/h7S5gkspQHCAi7vl13UxWlgKF+ORcHF2t
fHDh1ZcNkJNsYD1YYp9E9ci8JtI0TSPCcAbqHUqbRBMIyAbW8EJ6SgQ2jGGCyL8N
FK6o8MtAIu7VjNq0LE6PiPEcLT9BfGnt+Q6u4lKDQZWlaSTZF61vWd7ayamlycgt
lkuJsCNrtcWXGdxJBiqSKFlKASr/xg5OO0JNldgTJTuU5vMxnIMg5V0xtvKkFpqi
zXhBSzcmXY1V+bahM56e37tSAKCku4EYnYj1WtGlnhOAl4jhNPAEhB86HwzLFBzt
87kKMahPZ5/+0Q47AlcXvJSdMYRh9Rlo1zOaHWfSboMuplYhNr3z6oTDLLk3sNcM
NXJxrKov84DkM8SxlvcmqCYQgsIywV5kG+PIwOE275+N58syRPW4wGvmgg6YpNTL
K4M7D+2KPELzn6fsYF5STN9KT2TqfrzsnHE3QW3+hVtOuqmdTto=
=dLuo
-----END PGP SIGNATURE-----

Closed
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 72482@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 72482
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch