summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorHerman Rimm <herman@rimm.ee>2024-05-05 08:26:42 +0200
committerLudovic Courtès <ludo@gnu.org>2026-05-29 14:23:28 +0200
commit4514f4cf198e76bf4ca6df002ea3b38c516be5ce (patch)
tree7f73e0951fe0ce05671da179061ae940b238ab1a /doc
parent1d3d136bb0e2c0373f913adfe9a69be9df4a83b4 (diff)
scripts: lint: Add 'whole-file' option with ordering checker.
* guix/scripts/lint.scm (show-help): Describe option. (%options): Add 'whole-file' option. (guix-lint): Run checkers on packages defined in files. * doc/guix.texi (Invoking guix lint): Document option. * tests/guix-lint.sh: Define unordered package and invoke new option. Change-Id: I52b48a9a6982d0c4a03416e3d070887c64716485 Signed-off-by: Ludovic Courtès <ludo@gnu.org> Merges: #8796
Diffstat (limited to 'doc')
-rw-r--r--doc/guix.texi26
1 files changed, 23 insertions, 3 deletions
diff --git a/doc/guix.texi b/doc/guix.texi
index 209becd722a..30c91d0df9d 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -124,7 +124,7 @@ Copyright @copyright{} 2023 Thomas Ieong@*
124Copyright @copyright{} 2023 Saku Laesvuori@* 124Copyright @copyright{} 2023 Saku Laesvuori@*
125Copyright @copyright{} 2023 Graham James Addis@* 125Copyright @copyright{} 2023 Graham James Addis@*
126Copyright @copyright{} 2023-2025 Tomas Volf@* 126Copyright @copyright{} 2023-2025 Tomas Volf@*
127Copyright @copyright{} 2024, 2025 Herman Rimm@* 127Copyright @copyright{} 2024-2026 Herman Rimm@*
128Copyright @copyright{} 2024 Matthew Trzcinski@* 128Copyright @copyright{} 2024 Matthew Trzcinski@*
129Copyright @copyright{} 2024 Richard Sent@* 129Copyright @copyright{} 2024 Richard Sent@*
130Copyright @copyright{} 2024 Dariqq@* 130Copyright @copyright{} 2024 Dariqq@*
@@ -16710,6 +16710,12 @@ guix lint @var{options} @var{package}@dots{}
16710@end example 16710@end example
16711 16711
16712If no package is given on the command line, then all packages are checked. 16712If no package is given on the command line, then all packages are checked.
16713To check packages in particular source files, the syntax is:
16714
16715@example
16716guix lint @var{options} --whole-file @var{file}@dots{}
16717@end example
16718
16713The @var{options} may be zero or more of the following: 16719The @var{options} may be zero or more of the following:
16714 16720
16715@table @code 16721@table @code
@@ -16747,9 +16753,23 @@ Only enable the checkers that do not depend on Internet access.
16747Add @var{directory} to the front of the package module search path 16753Add @var{directory} to the front of the package module search path
16748(@pxref{Package Modules}). 16754(@pxref{Package Modules}).
16749 16755
16750This allows users to define their own packages and make them visible to 16756@item --whole-file
16751the command-line tools. 16757@itemx -f
16758Check the top-level package definitions in the given files; subsequent
16759arguments are treated as file names rather than package names. This
16760option also enables a special checker which checks if a package
16761alphabetically succeeds the one above it.
16762
16763For example, to check if the packages in @file{gnu/packages/matrix.scm}
16764are sorted alphabetically, and if the package names therein follow
16765established conventions, run:
16766
16767@example
16768guix lint -c name -f gnu/packages/matrix.scm
16769@end example
16752 16770
16771The previous two options allow users to define their own packages and
16772make them visible to the command-line tools.
16753@end table 16773@end table
16754 16774
16755@node Invoking guix size 16775@node Invoking guix size