@@ -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@*
@@ -15448,6 +15448,20 @@ Invoking guix lint
to the new style.
@end table
+When developing a package, 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 '((lint-excluded-checkers . (archival home-page)))))
+@end lisp
+
The general syntax is:
@example
@@ -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.
@@ -59,6 +59,15 @@ (define (emit-warnings warnings)
name version message))))
warnings))
+(define (exclude-package-checkers package checkers)
+ "Filter the CHECKERS list using PACKAGE properties field."
+ (let* ((properties (package-properties package))
+ (excluded-checkers (or (assq-ref properties 'lint-excluded-checkers)
+ '())))
+ (remove (lambda (checker)
+ (member (lint-checker-name checker) excluded-checkers))
+ checkers)))
+
(define* (run-checkers package checkers #:key store)
"Run the given CHECKERS on PACKAGE."
(let ((tty? (isatty? (current-error-port))))
@@ -72,7 +81,8 @@ (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)
+ (exclude-package-checkers
+ package checkers))
(when tty?
(format (current-error-port) "\x1b[K")
(force-output (current-error-port)))))
@@ -227,6 +237,8 @@ (define-command (guix-lint . args)
(let* ((name (package-name package))
(version (package-version package))
(loc (package-location package))
+ (checkers (exclude-package-checkers
+ package checkers))
(number-checkers (length checkers))
(number-all-checkers (length %all-checkers)))
(cond