From 6f892630ae4726297944fe34b3de4fb608caf66d Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 3 Jan 2022 11:04:40 +0100 Subject: style: Add support for "newline forms". This allows us to express cases where a newline should be inserted immediately after the head symbol of a list. * guix/scripts/style.scm (%newline-forms): New variable. (newline-form?): New procedure. (pretty-print-with-comments): Handle "newline forms". * tests/style.scm: Add test. --- tests/style.scm | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'tests') diff --git a/tests/style.scm b/tests/style.scm index 6c449cb72e..8022688419 100644 --- a/tests/style.scm +++ b/tests/style.scm @@ -465,6 +465,19 @@ mnopqrstuvwxyz.\")" ;; Regular indentation for 'replace' here. (replace \"gmp\" gmp))") +(test-pretty-print "\ +(package + ;; Here 'sha256', 'base32', and 'arguments' must be + ;; immediately followed by a newline. + (source (origin + (method url-fetch) + (sha256 + (base32 + \"not a real base32 string\")))) + (arguments + '(#:phases %standard-phases + #:tests? #f)))") + (test-end) ;; Local Variables: -- cgit v1.2.3