guix style frequently wraps lines beyond 80 characters limit

  • Open
  • quality assurance status badge
Details
One participant
  • Maxim Cournoyer
Owner
unassigned
Submitted by
Maxim Cournoyer
Severity
normal
M
M
Maxim Cournoyer wrote on 20 Mar 2023 22:20
(name . bug-guix)(address . bug-guix@gnu.org)
87y1nr2k8k.fsf@gmail.com
Hello Guix,

The "guix style" command appears to be too lenient on our maximum width
limit; it frequently overflows the 80 characters limit, as demonstrated
in the following example:

Before (max width: 77 characters)
Toggle snippet (43 lines)
(define-public emacs-transient
(let ((commit "0ae0de43590b5b6984a83f9e044e7c426455ac6e")
(revision "1"))
(package
(name "emacs-transient")
(version (git-version "0.3.7" revision commit))
(source
(origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/magit/transient")
(commit (string-append "v" version))))
(file-name (git-file-name name version))
(sha256
(base32 "0c7wbd0j0b802bzdpdkrx2q7wm7b9s56rk554dnadkpywhmdiqwn"))))
(build-system emacs-build-system)
(arguments
`(#:tests? #f ;no test suite
#:phases
(modify-phases %standard-phases
(add-after 'unpack 'build-info-manual
(lambda _
(invoke "make" "info")
;; Move the info file to lisp so that it gets installed by the
;; emacs-build-system.
(rename-file "docs/transient.info" "lisp/transient.info")))
(add-after 'build-info-manual 'enter-lisp-directory
(lambda _
(chdir "lisp"))))))
(native-inputs
(list texinfo))
(propagated-inputs
(list emacs-dash))
(home-page "https://magit.vc/manual/transient")
(synopsis "Transient commands in Emacs")
(description "Taking inspiration from prefix keys and prefix arguments
in Emacs, Transient implements a similar abstraction involving a prefix
command, infix arguments and suffix commands. We could call this abstraction
a \"transient command\", but because it always involves at least two
commands (a prefix and a suffix) we prefer to call it just a \"transient\".")
(license license:gpl3+))))

After (max width: 86 characters)
Toggle snippet (42 lines)
(define-public emacs-transient
(let ((commit "0ae0de43590b5b6984a83f9e044e7c426455ac6e")
(revision "1"))
(package
(name "emacs-transient")
(version (git-version "0.3.7" revision commit))
(source (origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/magit/transient")
(commit (string-append "v" version))))
(file-name (git-file-name name version))
(sha256
(base32
"0c7wbd0j0b802bzdpdkrx2q7wm7b9s56rk554dnadkpywhmdiqwn"))))
(build-system emacs-build-system)
(arguments
`(#:tests? #f ;no test suite
#:phases (modify-phases %standard-phases
(add-after 'unpack 'build-info-manual
(lambda _
(invoke "make" "info")
;; Move the info file to lisp so that it gets installed by the
;; emacs-build-system.
(rename-file "docs/transient.info"
"lisp/transient.info")))
(add-after 'build-info-manual 'enter-lisp-directory
(lambda _
(chdir "lisp"))))))
(native-inputs (list texinfo))
(propagated-inputs (list emacs-dash))
(home-page "https://magit.vc/manual/transient")
(synopsis "Transient commands in Emacs")
(description
"Taking inspiration from prefix keys and prefix arguments
in Emacs, Transient implements a similar abstraction involving a prefix
command, infix arguments and suffix commands. We could call this abstraction
a \"transient command\", but because it always involves at least two
commands (a prefix and a suffix) we prefer to call it just a \"transient\".")
(license license:gpl3+))))

--
Thanks,
Maxim
M
M
Maxim Cournoyer wrote on 21 Mar 2023 04:38
(address . 62303@debbugs.gnu.org)
87h6ueu63b.fsf@gmail.com
Hello,

Here's another example, on mygnuhealth (just committed):

Toggle snippet (36 lines)
modified gnu/packages/medical.scm
@@ -46,19 +46,19 @@ (define-public mygnuhealth
"1jcrriccqzb4jx7zayhiqmpvi3cvfy3bbf9zr3m83878f94yww8j"))))
(build-system python-build-system)
(arguments
- (list
- #:imported-modules `(,@%python-build-system-modules
- ,@%qt-build-system-modules)
- #:modules `(((guix build qt-build-system) #:prefix qt:)
- (guix build python-build-system)
- (guix build utils))
- #:phases #~(modify-phases %standard-phases
- (add-after 'install 'qt-wrap
- (assoc-ref qt:%standard-phases 'qt-wrap))
- (add-before 'check 'env-setup
- (lambda _
- (mkdir-p "/tmp/mygh/")
- (setenv "HOME" "/tmp"))))))
+ (list #:imported-modules `(,@%python-build-system-modules ,@%qt-build-system-modules)
+ #:modules `(((guix build qt-build-system)
+ #:prefix qt:)
+ (guix build python-build-system)
+ (guix build utils))
+ #:phases #~(modify-phases %standard-phases
+ (add-after 'install 'qt-wrap
+ (assoc-ref qt:%standard-phases
+ 'qt-wrap))
+ (add-before 'check 'env-setup
+ (lambda _
+ (mkdir-p "/tmp/mygh/")
+ (setenv "HOME" "/tmp"))))))
(native-inputs (list python-pyside-2))
(inputs (list bash-minimal
kirigami

The max width reaches 90 characters.

--
Thanks,
Maxim
?
Your comment

Commenting via the web interface is currently disabled.

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

To respond to this issue using the mumi CLI, first switch to it
mumi current 62303
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