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


View this message in rfc822 format

From: Simon Tournier <zimon.toutoune <at> gmail.com>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: Josselin Poiret <dev <at> jpoiret.xyz>, Maxim Cournoyer <maxim.cournoyer <at> gmail.com>, Mathieu Othacehe <othacehe <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: [bug#71697] [PATCH v4 1/2] scripts: lint: Add 'dry-run' option.
Date: Thu, 18 Jul 2024 13:00:46 +0200
Hi,

On Thu, 18 Jul 2024 at 11:19, Ludovic Courtès <ludo <at> gnu.org> wrote:

>                                          That said, I find ‘--dry-run’
> in this case not so useful because it would just print the same thing on
> and on for each and every package.

No, it’s different; or can be.  For instance, ’archival’ is listed for
one but not for the other.

--8<---------------cut here---------------start------------->8---
$ git diff
diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index 3680cab044..5a22f7a865 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -1775,6 +1775,7 @@ (define-public python-scikit-learn
            python-pytest-xdist))
     (propagated-inputs
      (list python-numpy python-threadpoolctl python-scipy python-joblib))
+    (properties '((lint-excluded-checkers . (archival name synopsis))))
     (home-page "https://scikit-learn.org/")
     (synopsis "Machine Learning in Python")
     (description

$ ./pre-inst-env guix lint hello python-scikit-learn --dry-run
hello <at> 2.12.1 checked by archival compiler-for-target cve derivation description formatting github-url gnu-description haskell-stackage home-page input-labels inputs-should-be-native inputs-should-not-be-input license mirror-url name optional-tests patch-file-names patch-headers profile-collisions refresh source source-file-name source-unstable-tarball synopsis tests-true wrapper-inputs.
python-scikit-learn <at> 1.4.2 checked by compiler-for-target cve derivation description formatting github-url gnu-description haskell-stackage home-page input-labels inputs-should-be-native inputs-should-not-be-input license mirror-url optional-tests patch-file-names patch-headers profile-collisions refresh source source-file-name source-unstable-tarball tests-true wrapper-inputs.
--8<---------------cut here---------------end--------------->8---

Well, the aim is to know which checker applies to which package just
before they are indeed applied.

Initially, I thought something like:

--8<---------------cut here---------------start------------->8---
modified   guix/scripts/lint.scm
@@ -223,6 +223,11 @@ (define-command (guix-lint . args)
     (when (assoc-ref opts 'list?)
       (list-checkers-and-exit checkers))
 
+    (when (assoc-ref opts 'dry-run?)
+      (if (null? args)
+          (show-checkers-and-exit)
+          (show-packages-checkers-and-exit args checkers)))
+
     (with-error-handling
       (let ((any-lint-checker-requires-store?
              (any lint-checker-requires-store? checkers)))
--8<---------------cut here---------------end--------------->8---

where ’show-checkers-and-exit’ takes into account only option ’-c’ or
option ’-x’, displaying something as: “The following checkers would run
for all <number of packages> packages:” and the list of checkers.

And ’show-packages-checkers-and-exit’ would display:

--8<---------------cut here---------------start------------->8---
The following checkers would run for packages: <"short“ "list of package <at> X.Y>

 + list of all common checkers

The following checkers would be excluded for packages: <"short“ "list of package <at> X.Y>

 + list of excluded checkers
--8<---------------cut here---------------end--------------->8---

But then I concluded that would not be a true dry-run. ;-)


For the comments, thanks!  That’s better.

Cheers,
simon






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.