diff options
author | Ludovic Courtès <ludo@gnu.org> | 2022-06-22 23:39:50 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2022-06-22 23:42:30 +0200 |
commit | 2ccbf3a45ccb5b1ac469f3d429faf4c51c56f38a (patch) | |
tree | fb2923635bb6ef74079708720a67a8e463f5c58e /guix/scripts | |
parent | c9d78e40749fd5348c2776b88a793d76df111cc0 (diff) | |
download | guix-patches-2ccbf3a45ccb5b1ac469f3d429faf4c51c56f38a.tar guix-patches-2ccbf3a45ccb5b1ac469f3d429faf4c51c56f38a.tar.gz |
style: Keep values next to their keyword.
This ensures we print '#:key value' rather than insert a newline
between '#:key' and 'value' as was the case before.
* guix/scripts/style.scm (pretty-print-with-comments)[print-sequence]:
When ITEM is a keyword, loop with FIRST? = true.
* tests/style.scm: Add test.
Diffstat (limited to 'guix/scripts')
-rw-r--r-- | guix/scripts/style.scm | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/guix/scripts/style.scm b/guix/scripts/style.scm index 8123570c38..ca3853af5e 100644 --- a/guix/scripts/style.scm +++ b/guix/scripts/style.scm @@ -303,7 +303,8 @@ FORMAT-COMMENT is 'canonicalize-comment'." (newline port) (display (make-string indent #\space) port)) (let ((column (if newline? indent column))) - (print tail #f + (print tail + (keyword? item) ;keep #:key value next to one another (comment? item) (loop indent column (or newline? delimited?) |