summary refs log tree commit diff
path: root/tests/style.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2022-01-02 17:29:12 +0100
committerLudovic Courtès <ludo@gnu.org>2022-01-10 14:59:26 +0100
commitc4fe13c294cc1e31dd8a49ce3981f603fb169e0a (patch)
treee5d5136d502ebfdc62e862d0f7b325d5bf86ef2b /tests/style.scm
parent6f892630ae4726297944fe34b3de4fb608caf66d (diff)
downloadguix-c4fe13c294cc1e31dd8a49ce3981f603fb169e0a.tar.gz
style: Add '--styling' option.
* guix/scripts/style.scm (format-package-definition): New procedure.
(%options, show-help): Add "--styling".
(%default-options): Add 'styling-procedure'.
(guix-style): Honor it.
* tests/style.scm (with-test-package)
("input labels, 'safe' policy")
("input labels, 'safe' policy, nothing changed")
("input labels, margin comment")
("input labels, margin comment on long list")
("input labels, line comment")
("input labels, modify-inputs and margin comment"): Pass "-S inputs".
* etc/indent-code.el: Remove.
* doc/contributing.texi (Formatting Code): Mention "guix style" instead
of "etc/indent-code.el".
(Submitting Patches): Add item for "guix style".
* doc/guix.texi (Invoking guix style): Document "-S" and update.
Diffstat (limited to 'tests/style.scm')
-rw-r--r--tests/style.scm17
1 files changed, 12 insertions, 5 deletions
diff --git a/tests/style.scm b/tests/style.scm
index 8022688419..7dae543860 100644
--- a/tests/style.scm
+++ b/tests/style.scm
@@ -78,7 +78,8 @@
         (string-append directory "/my-packages.scm"))
 
       ;; Run as a separate process to make sure FILE is reloaded.
-      (system* "guix" "style" "-L" directory "my-coreutils")
+      (system* "guix" "style" "-L" directory "-S" "inputs"
+               "my-coreutils")
       (system* "cat" file)
 
       (load file)
@@ -237,6 +238,7 @@
         (string-append directory "/my-packages.scm"))
 
       (system* "guix" "style" "-L" directory "my-coreutils"
+               "-S" "inputs"
                "--input-simplification=safe")
 
       (load file)
@@ -258,6 +260,7 @@
         (string-append directory "/my-packages.scm"))
 
       (system* "guix" "style" "-L" directory "my-coreutils"
+               "-S" "inputs"
                "--input-simplification=safe")
 
       (load file)
@@ -284,7 +287,8 @@
                         " ;another one\n")))
       (system* "cat" file)
 
-      (system* "guix" "style" "-L" directory "my-coreutils")
+      (system* "guix" "style" "-L" directory "-S" "inputs"
+               "my-coreutils")
 
       (load file)
       (list (package-inputs (@ (my-packages) my-coreutils))
@@ -317,7 +321,8 @@
                         " ;margin comment\n")))
       (system* "cat" file)
 
-      (system* "guix" "style" "-L" directory "my-coreutils")
+      (system* "guix" "style" "-L" directory "-S" "inputs"
+               "my-coreutils")
 
       (load file)
       (list (package-inputs (@ (my-packages) my-coreutils))
@@ -338,7 +343,8 @@
         ((",gmp\\)(.*)$" _ rest)
          (string-append ",gmp)\n   ;; line comment!\n" rest)))
 
-      (system* "guix" "style" "-L" directory "my-coreutils")
+      (system* "guix" "style" "-L" directory "-S" "inputs"
+               "my-coreutils")
 
       (load file)
       (list (package-inputs (@ (my-packages) my-coreutils))
@@ -364,7 +370,8 @@
         ((",acl\\)(.*)$" _ rest)
          (string-append ",acl) ;another one\n" rest)))
 
-      (system* "guix" "style" "-L" directory "my-coreutils")
+      (system* "guix" "style" "-L" directory "-S" "inputs"
+               "my-coreutils")
 
       (load file)
       (list (package-inputs (@ (my-packages) my-coreutils))