From patchwork Fri Jun 21 18:33:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Simon Tournier X-Patchwork-Id: 65524 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 4ED5627BBEA; Fri, 21 Jun 2024 19:35:28 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 7B2D727BBE2 for ; Fri, 21 Jun 2024 19:35:27 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sKj6V-0004vD-Vf; Fri, 21 Jun 2024 14:35:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKj6V-0004sz-7g for guix-patches@gnu.org; Fri, 21 Jun 2024 14:35:19 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sKj6M-00027e-JA; Fri, 21 Jun 2024 14:35:18 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sKj6E-0004A0-2P; Fri, 21 Jun 2024 14:35:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#71697] [PATCH v2] guix: scripts: lint: Honor package property to exclude chercker. References: <8cb162bcde91d3b39453de576caadb9a6f8f8733.1718990517.git.zimon.toutoune@gmail.com> In-Reply-To: <8cb162bcde91d3b39453de576caadb9a6f8f8733.1718990517.git.zimon.toutoune@gmail.com> Resent-From: Simon Tournier Original-Sender: "Debbugs-submit" Resent-CC: guix@cbaines.net, pelzflorian@pelzflorian.de, dev@jpoiret.xyz, ludo@gnu.org, othacehe@gnu.org, matt@excalamus.com, maxim.cournoyer@gmail.com, rekado@elephly.net, zimon.toutoune@gmail.com, me@tobias.gr, guix-patches@gnu.org Resent-Date: Fri, 21 Jun 2024 18:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71697 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 71697@debbugs.gnu.org Cc: Simon Tournier , Christopher Baines , Florian Pelz , Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Matthew Trzcinski , Maxim Cournoyer , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice X-Debbugs-Original-Xcc: Christopher Baines , Florian Pelz , Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Matthew Trzcinski , Maxim Cournoyer , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice Received: via spool by 71697-submit@debbugs.gnu.org id=B71697.171899488715959 (code B ref 71697); Fri, 21 Jun 2024 18:35:02 +0000 Received: (at 71697) by debbugs.gnu.org; 21 Jun 2024 18:34:47 +0000 Received: from localhost ([127.0.0.1]:43468 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sKj5z-00049L-8q for submit@debbugs.gnu.org; Fri, 21 Jun 2024 14:34:47 -0400 Received: from mail-lf1-f48.google.com ([209.85.167.48]:40827) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sKj5v-000492-SV for 71697@debbugs.gnu.org; Fri, 21 Jun 2024 14:34:45 -0400 Received: by mail-lf1-f48.google.com with SMTP id 2adb3069b0e04-52bc0236f04so343682e87.3 for <71697@debbugs.gnu.org>; Fri, 21 Jun 2024 11:34:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718994818; x=1719599618; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=HVAO5DtNU0JFGh3skv5JK9JIYs/VAz9vYSg5oGKnJtg=; b=bBOygU3KMNXLIjVLfQZMXJ9zRIKKgUkR0WGm9id4AsG2IJeqFEi+gA7TrLZU39/zjQ 63nMlGuInyUrwC9M0/KPqQhsCtxIe/uXmrM1RNmII4omq7BS3UBgL1FPpcroyrWLvrDF bQ4rCRgrWjaLNuDbHP+ob5v4k4rscdu9imIZgXzhVUyD8Yry7yZLC2lyZt0KaJL1IrqE lIOqmqfvysc310W60Ml6gJ/z6mJOimy3bSaMj6FjkMnHJ4FNUC/UegWybwzbq4l2BAkn 9Cgnj/MX1EqlLwsbLvTUrsVIddT+ERmTghnwm9YY5KiRjeC0Lt+gqANoMxA1jM5KaMAh unAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718994818; x=1719599618; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=HVAO5DtNU0JFGh3skv5JK9JIYs/VAz9vYSg5oGKnJtg=; b=qCtFjYtI8yZz7Q8kWd506kBHBK0tgJZ384Ya8ZipMHLtYsGkK4f0Kn+XIh0CKR/lV2 1AOzmxbMTk1lHboxU1R5OqPQrX4JxScMMISDp/7kVNept4QZGrmUxV89dj+5ZCMkGkIB H5mo3iqR92aEhWiP7jv34ECZvex69XT70yfC5SVYlB3xruSQwAGmeAfruVePl3OomvnR /5VuvuAuMLFdkzGa+Td6u8XeUypzBpw+RXoQCwYgpdVfJluqVN1258KstiVW0w8rP6Au JUkG268WdlZzW1mu9BEVwhATxQkEKfN3UP84POm6wsHD7VcPUQjcEDP9qcjQ7ewHxcTS 3v5A== X-Gm-Message-State: AOJu0YzzwMhGgMX4zB68+pUXeOoUm1LrqLeLvMO6b9SoAsf2fOkhxdel LEV38Ih9NnNn0Sr6tsTPuVLCVJu+AEqpiBZongv9hqPoMeedVNDsTfevNw== X-Google-Smtp-Source: AGHT+IEwcBCCTgHhGkiaKmsaoguo+m4QPOd0wXPQMjH1kT/bcDRNfiPfKJffAHDYV9Wv0g6pDsRAuw== X-Received: by 2002:a05:6512:b22:b0:52c:cd07:37b6 with SMTP id 2adb3069b0e04-52ccd0738b3mr5501947e87.1.1718994817573; Fri, 21 Jun 2024 11:33:37 -0700 (PDT) Received: from lili.. ([89.207.175.12]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-366d5cbd5bbsm1625604f8f.97.2024.06.21.11.33.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jun 2024 11:33:36 -0700 (PDT) From: Simon Tournier Date: Fri, 21 Jun 2024 20:33:28 +0200 Message-ID: <4e0382d4b36b12d59774d23e0e9177889e2398f2.1718994792.git.zimon.toutoune@gmail.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * 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(-) base-commit: bc8a41f4a8d9f1f0525d7bc97c67ed3c8aea3111 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 ;;; Copyright © 2017, 2018 Efraim Flashner ;;; Copyright © 2018, 2019 Arun Isaac -;;; Copyright © 2019, 2020 Simon Tournier +;;; Copyright © 2019, 2020, 2024 Simon Tournier ;;; Copyright © 2020 Brice Waegeneire ;;; ;;; 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)))))