diff options
| author | Herman Rimm <herman@rimm.ee> | 2024-05-05 08:26:42 +0200 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2026-05-29 14:23:28 +0200 |
| commit | 4514f4cf198e76bf4ca6df002ea3b38c516be5ce (patch) | |
| tree | 7f73e0951fe0ce05671da179061ae940b238ab1a /doc | |
| parent | 1d3d136bb0e2c0373f913adfe9a69be9df4a83b4 (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.texi | 26 |
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@* | |||
| 124 | Copyright @copyright{} 2023 Saku Laesvuori@* | 124 | Copyright @copyright{} 2023 Saku Laesvuori@* |
| 125 | Copyright @copyright{} 2023 Graham James Addis@* | 125 | Copyright @copyright{} 2023 Graham James Addis@* |
| 126 | Copyright @copyright{} 2023-2025 Tomas Volf@* | 126 | Copyright @copyright{} 2023-2025 Tomas Volf@* |
| 127 | Copyright @copyright{} 2024, 2025 Herman Rimm@* | 127 | Copyright @copyright{} 2024-2026 Herman Rimm@* |
| 128 | Copyright @copyright{} 2024 Matthew Trzcinski@* | 128 | Copyright @copyright{} 2024 Matthew Trzcinski@* |
| 129 | Copyright @copyright{} 2024 Richard Sent@* | 129 | Copyright @copyright{} 2024 Richard Sent@* |
| 130 | Copyright @copyright{} 2024 Dariqq@* | 130 | Copyright @copyright{} 2024 Dariqq@* |
| @@ -16710,6 +16710,12 @@ guix lint @var{options} @var{package}@dots{} | |||
| 16710 | @end example | 16710 | @end example |
| 16711 | 16711 | ||
| 16712 | If no package is given on the command line, then all packages are checked. | 16712 | If no package is given on the command line, then all packages are checked. |
| 16713 | To check packages in particular source files, the syntax is: | ||
| 16714 | |||
| 16715 | @example | ||
| 16716 | guix lint @var{options} --whole-file @var{file}@dots{} | ||
| 16717 | @end example | ||
| 16718 | |||
| 16713 | The @var{options} may be zero or more of the following: | 16719 | The @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. | |||
| 16747 | Add @var{directory} to the front of the package module search path | 16753 | Add @var{directory} to the front of the package module search path |
| 16748 | (@pxref{Package Modules}). | 16754 | (@pxref{Package Modules}). |
| 16749 | 16755 | ||
| 16750 | This allows users to define their own packages and make them visible to | 16756 | @item --whole-file |
| 16751 | the command-line tools. | 16757 | @itemx -f |
| 16758 | Check the top-level package definitions in the given files; subsequent | ||
| 16759 | arguments are treated as file names rather than package names. This | ||
| 16760 | option also enables a special checker which checks if a package | ||
| 16761 | alphabetically succeeds the one above it. | ||
| 16762 | |||
| 16763 | For example, to check if the packages in @file{gnu/packages/matrix.scm} | ||
| 16764 | are sorted alphabetically, and if the package names therein follow | ||
| 16765 | established conventions, run: | ||
| 16766 | |||
| 16767 | @example | ||
| 16768 | guix lint -c name -f gnu/packages/matrix.scm | ||
| 16769 | @end example | ||
| 16752 | 16770 | ||
| 16771 | The previous two options allow users to define their own packages and | ||
| 16772 | make 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 |
