Message ID | 3418edcdafdf9b6551759f4a392d8d3466f255c4.1630850420.git.public@yoctocell.xyz |
---|---|
State | Accepted |
Headers | show |
Series | [bug#50401] scripts: import: Increase column width for pretty-printer. | expand |
Context | Check | Description |
---|---|---|
cbaines/applying patch | fail | View Laminar job |
cbaines/issue | success | View issue |
Hi, Xinglu Chen <public@yoctocell.xyz> skribis: > Previously, the max column width for the pretty-printer was 50, which caused > generated package definitions to include unnecessary newlines, e.g., > > (home-page > "https://gitlab.com/ttyperacer/terminal-typeracer") > > instead of > > (home-page "https://gitlab.com/ttyperacer/terminal-typeracer") > > * guix/scripts/import.scm (guix-import): Set max expression width to 80 when > pretty-printing. Applied! I wonder why we never realized before… Thank you! Ludo’.
diff --git a/guix/scripts/import.scm b/guix/scripts/import.scm index b369a362d0..73508bade2 100644 --- a/guix/scripts/import.scm +++ b/guix/scripts/import.scm @@ -3,6 +3,7 @@ ;;; Copyright © 2014 David Thompson <davet@gnu.org> ;;; Copyright © 2018 Kyle Meyer <kyle@kyleam.com> ;;; Copyright © 2019 Ricardo Wurmus <rekado@elephly.net> +;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz> ;;; ;;; This file is part of GNU Guix. ;;; @@ -117,7 +118,8 @@ Run IMPORTER with ARGS.\n")) (if (member importer importers) (let ((print (lambda (expr) (pretty-print expr (newline-rewriting-port - (current-output-port)))))) + (current-output-port)) + #:max-expr-width 80)))) (match (apply (resolve-importer importer) args) ((and expr (or ('package _ ...) ('let _ ...)