1
0
mirror of https://git.savannah.gnu.org/git/guix.git synced 2026-05-28 03:51:53 +02:00

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.
This commit is contained in:
Ludovic Courtès
2022-01-02 17:29:12 +01:00
parent 6f892630ae
commit c4fe13c294
5 changed files with 111 additions and 147 deletions
+12 -5
View File
@@ -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))