[bug#70499,v2,0/3] Lint package order.

Message ID cover.1714923771.git.herman@rimm.ee
Headers
Series Lint package order. |

Message

Herman Rimm May 5, 2024, 5:25 p.m. UTC
Hi,

I do not think 'find-unordered-packages' would be useful for e.g. guix
style, so I made a similar procedure in (guix scripts lint) instead.  It
is implemented with 'fold-packages' to get package records to pass to
the 'run-checkers' procedure.  So now you can use guix lint with
--whole-file to also lint the package ordering, for example:

  $ guix lint -f gnu/packages/matrix.scm -n
  gnu/packages/matrix.scm:161:0: python-matrix-nio@0.20.2: breaks from alphabetical order
  gnu/packages/matrix.scm:244:0: pantalaimon@0.10.5: breaks from alphabetical order

However the alphabetical order lint warnings only appear once another
type of lint warning is emitted, or when end of file is reached and
linting finishes. So if few checkers are enabled, it takes a few seconds
before anything is output for large module files, like 'crates-io.scm'.
Can this be fixed easily?

Cheers,
Herman

Herman Rimm (3):
  guix: Move ‘package-location<?’ to (guix packages).
  ui: Make 'user-module' parameter of 'load*' optional.
  scripts: lint: Add 'whole-file' option with ordering lint.

 doc/guix.texi          | 23 ++++++++++++++++--
 guix/packages.scm      | 11 +++++++++
 guix/scripts/lint.scm  | 55 +++++++++++++++++++++++++++++++++++++-----
 guix/scripts/style.scm |  9 -------
 guix/ui.scm            |  3 ++-
 5 files changed, 83 insertions(+), 18 deletions(-)


base-commit: ef8ab6ab66c4d629699d175938ef1912941d4dce