all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Simon Tournier <zimon.toutoune@gmail.com>
To: 71697@debbugs.gnu.org
Cc: "Simon Tournier" <zimon.toutoune@gmail.com>,
	"Christopher Baines" <guix@cbaines.net>,
	"Florian Pelz" <pelzflorian@pelzflorian.de>,
	"Josselin Poiret" <dev@jpoiret.xyz>,
	"Ludovic Courtès" <ludo@gnu.org>,
	"Mathieu Othacehe" <othacehe@gnu.org>,
	"Matthew Trzcinski" <matt@excalamus.com>,
	"Maxim Cournoyer" <maxim.cournoyer@gmail.com>,
	"Ricardo Wurmus" <rekado@elephly.net>,
	"Simon Tournier" <zimon.toutoune@gmail.com>,
	"Tobias Geerinckx-Rice" <me@tobias.gr>
Subject: [bug#71697] [PATCH v2] guix: scripts: lint: Honor package property to exclude chercker.
Date: Fri, 21 Jun 2024 20:33:28 +0200	[thread overview]
Message-ID: <4e0382d4b36b12d59774d23e0e9177889e2398f2.1718994792.git.zimon.toutoune@gmail.com> (raw)
In-Reply-To: <8cb162bcde91d3b39453de576caadb9a6f8f8733.1718990517.git.zimon.toutoune@gmail.com>

* guix/scripts/lint.scm (run-checkers): Skip the checker if the package is
marked.
* doc/guix.texi: Document it.

Change-Id: Idf8e5c67102a1701ebd917bbc6212cfeb6ea2054
---
 doc/guix.texi         | 17 ++++++++++++++++-
 guix/scripts/lint.scm | 17 +++++++++++++++--
 2 files changed, 31 insertions(+), 3 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 769ca1399f..46a4079c4b 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -71,7 +71,7 @@
 Copyright @copyright{} 2019 Alex Griffin@*
 Copyright @copyright{} 2019, 2020, 2021, 2022 Guillaume Le Vaillant@*
 Copyright @copyright{} 2020 Liliana Marie Prikler@*
-Copyright @copyright{} 2019, 2020, 2021, 2022, 2023 Simon Tournier@*
+Copyright @copyright{} 2019, 2020, 2021, 2022, 2023, 2024 Simon Tournier@*
 Copyright @copyright{} 2020 Wiktor Żelazny@*
 Copyright @copyright{} 2020 Damien Cassou@*
 Copyright @copyright{} 2020 Jakub Kądziołka@*
@@ -15444,6 +15444,21 @@ Invoking guix lint
 to the new style.
 @end table
 
+Sometimes it is not desired to run the same checker each time
+@command{guix lint} is invoked---e.g., because the checker takes time or
+to avoid to send again and again the same request for archiving.
+Instead of excluding the checker at the command-line via the option
+@code{--exclude}, the package might be marked to skip the checker by
+honoring the property in package definition, e.g.,
+
+@lisp
+(package
+  (name "python-scikit-learn")
+  ;; @dots{}
+  (properties '((no-archival . #t)
+                (no-name . #t))))
+@end lisp
+
 The general syntax is:
 
 @example
diff --git a/guix/scripts/lint.scm b/guix/scripts/lint.scm
index ee3de51fb1..d8bac277a0 100644
--- a/guix/scripts/lint.scm
+++ b/guix/scripts/lint.scm
@@ -9,7 +9,7 @@
 ;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2018, 2019 Arun Isaac <arunisaac@systemreboot.net>
-;;; Copyright © 2019, 2020 Simon Tournier <zimon.toutoune@gmail.com>
+;;; Copyright © 2019, 2020, 2024 Simon Tournier <zimon.toutoune@gmail.com>
 ;;; Copyright © 2020 Brice Waegeneire <brice@waegenei.re>
 ;;;
 ;;; This file is part of GNU Guix.
@@ -39,6 +39,7 @@ (define-module (guix scripts lint)
   #:use-module (ice-9 format)
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-37)
+  #:use-module (srfi srfi-26)
   #:export (guix-lint
             run-checkers))
 
@@ -61,6 +62,18 @@ (define (emit-warnings warnings)
 
 (define* (run-checkers package checkers #:key store)
   "Run the given CHECKERS on PACKAGE."
+  (define (checkers* checkers)
+    (let ((properties (package-properties package)))
+      (filter (lambda (checker)
+                (any  (lambda (p)
+                        (eq? p ((compose string->symbol
+                                         (cut string-append "no-" <>)
+                                         symbol->string
+                                         lint-checker-name)
+                                checker)))
+                      properties))
+              checkers)))
+
   (let ((tty? (isatty? (current-error-port))))
     (for-each (lambda (checker)
                 (when tty?
@@ -72,7 +85,7 @@ (define* (run-checkers package checkers #:key store)
                  (if (lint-checker-requires-store? checker)
                      ((lint-checker-check checker) package #:store store)
                      ((lint-checker-check checker) package))))
-              checkers)
+              (checkers* checkers))
     (when tty?
       (format (current-error-port) "\x1b[K")
       (force-output (current-error-port)))))

base-commit: bc8a41f4a8d9f1f0525d7bc97c67ed3c8aea3111
-- 
2.41.0





  reply	other threads:[~2024-06-21 19:27 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-21 17:22 [bug#71697] [PATCH] guix: lint: Honor 'no-archival?' package property Simon Tournier
2024-06-21 18:33 ` Simon Tournier [this message]
2024-06-21 21:09   ` [bug#71697] [PATCH v2] guix: scripts: lint: Honor package property to exclude chercker Liliana Marie Prikler
2024-06-22 14:29   ` MSavoritias
2024-06-22 15:40     ` Simon Tournier
2024-06-24  8:21       ` MSavoritias
2024-06-22 15:27 ` [bug#71697] [PATCH v3 1/2] scripts: lint: Add 'dry-run' option Simon Tournier
2024-06-22 15:27   ` [bug#71697] [PATCH v3 2/2] scripts: lint: Honor package property to exclude checkers Simon Tournier
2024-06-23 23:51     ` Maxim Cournoyer
2024-06-25 15:14     ` Ludovic Courtès
2024-06-25 17:14       ` Greg Hogan via Guix-patches
2024-06-26  8:24         ` Ricardo Wurmus
2024-06-26 19:28         ` Maxim Cournoyer
2024-06-27 16:38           ` Greg Hogan
2024-06-29  3:12             ` Maxim Cournoyer
2024-06-30 14:48               ` Dale Mellor
2024-07-01 20:44                 ` Maxim Cournoyer
     [not found]                   ` <72a5f3c9d0523b29ed99afd5a551b411f4c0e7f5.camel@rdmp.org>
2024-07-02  1:39                     ` Maxim Cournoyer
2024-06-23 23:54   ` [bug#71697] [PATCH v3 1/2] scripts: lint: Add 'dry-run' option Maxim Cournoyer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4e0382d4b36b12d59774d23e0e9177889e2398f2.1718994792.git.zimon.toutoune@gmail.com \
    --to=zimon.toutoune@gmail.com \
    --cc=71697@debbugs.gnu.org \
    --cc=dev@jpoiret.xyz \
    --cc=guix@cbaines.net \
    --cc=ludo@gnu.org \
    --cc=matt@excalamus.com \
    --cc=maxim.cournoyer@gmail.com \
    --cc=me@tobias.gr \
    --cc=othacehe@gnu.org \
    --cc=pelzflorian@pelzflorian.de \
    --cc=rekado@elephly.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.