GNU bug report logs - #71697
[PATCH] guix: lint: Honor 'no-archival?' package property.

Previous Next

Package: guix-patches;

Reported by: Simon Tournier <zimon.toutoune <at> gmail.com>

Date: Fri, 21 Jun 2024 18:13:01 UTC

Severity: normal

Tags: patch

Full log


Message #104 received at 71697 <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Simon Tournier <zimon.toutoune <at> gmail.com>
Cc: Josselin Poiret <dev <at> jpoiret.xyz>, Mathieu Othacehe <othacehe <at> gnu.org>,
 Ludovic Courtès <ludo <at> gnu.org>,
 Tobias Geerinckx-Rice <me <at> tobias.gr>,
 Florian Pelz <pelzflorian <at> pelzflorian.de>, 71697 <at> debbugs.gnu.org,
 Christopher Baines <guix <at> cbaines.net>, Matthew Trzcinski <matt <at> excalamus.com>
Subject: Re: [PATCH v5 3/3] scripts: lint: Add hint for checker typo.
Date: Fri, 26 Jul 2024 11:26:42 +0900
Hi,

Simon Tournier <zimon.toutoune <at> gmail.com> writes:

>
> Change-Id: I432c5b0570d2f413b59c2296666f3a4e5fb8c64c
> ---
>  guix/scripts/lint.scm | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/guix/scripts/lint.scm b/guix/scripts/lint.scm
> index 2df0cba948..f4aa394686 100644
> --- a/guix/scripts/lint.scm
> +++ b/guix/scripts/lint.scm
> @@ -31,6 +31,7 @@ (define-module (guix scripts lint)
>    #:use-module (guix packages)
>    #:use-module (guix lint)
>    #:use-module (guix ui)
> +  #:use-module ((guix utils) #:select (string-closest))
>    #:use-module (guix store)
>    #:use-module (guix scripts)
>    #:use-module (guix scripts build)
> @@ -147,7 +148,15 @@ (define (option-checker short-long)
>                                                   ((short long) long)))))
>                (for-each (lambda (c)
>                            (unless (memq c checker-names)
> -                            (leave (G_ "~a: invalid checker~%") c)))
> +                            (let* ((name (symbol->string c))
> +                                   (checkers (map symbol->string checker-names))
> +                                   (hint (string-closest name checkers
> +                                                         #:threshold 3)))
> +                              (report-error (G_ "~a: invalid checker~%") name)
> +                              (when hint
> +                                (display-hint
> +                                 (format #f (G_ "Did you mean @code{~a}?~%") hint)))
> +                              (exit 1))))
>                          names)
>                (alist-cons option-name
>                            (filter (lambda (checker)

Patch 1 and 3 LGTM.  Patch 2 I'd rather wait to see if we can think
about a better option to match the original use case (exclude the
archival checker from 'guix lint' for privately developed packages). I
remember that perhaps the simplest thing for that would be to add a
nonfree license to (guix licenses); Guix users developing nonfree
software (ugh) could mark it as such and the lint code could disable
archival for such licensed packages (or maybe more generally if the
license used is unknown to Guix).

-- 
Thanks,
Maxim




This bug report was last modified 1 year and 44 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.