From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id oOajDMFmkWb9ZwAAe85BDQ:P1 (envelope-from ) for ; Fri, 12 Jul 2024 17:24:17 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id oOajDMFmkWb9ZwAAe85BDQ (envelope-from ) for ; Fri, 12 Jul 2024 19:24:17 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=H02KXOJa; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1720805056; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=2gv+7f0rQwUo/1QWLs1vGfa+kqapI6Hu14gCpNPYs6s=; b=VeQZMsdbVn5b2g9mMHSb3aE4SfWvy2hjLo5Wq7xn87YtD3CsEhxX0cemLoWMYs2hScniBf NkhGPreYT0wdN1gTCgcF966785hGpPMgaj45C4uYLyQASpI+TPvF59JnHPjB83+K3pAdu8 eI5hBdPNqQwgCBow7f/xykNnkXVOYodGsfDdKYe/nyaFsSg8E0VuJ96k2DW3i2A78O8G6u 2BhL4JacTwAzrRe2KjkPpzkmMjME53KXriOE0Pcfk/YBrxekmzcNoQda2pvQwSMePLcFOj OoLJ/sBSdVJQQn9HtLr7t2f7McBXcxyenchxmZ1eOcN+9MMB01n+jwYfiaKhXg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1720805056; a=rsa-sha256; cv=none; b=T+CqhYWi97s5Lu4erWTHy7hygg3ffWJd5597inrKhUo18RYQ0D3kyonmqnA4iAsF/pdu0k ZE8iI7Pc59YwCsOot8vwqtasZ4rkN/z2AAcidlZi/3VtfWEMIK0kYGy4EtKsHc95WdVFlK oqLs4Et3LAiYvzDPkEgEumM9VYnJR6N/Gw9PvR8Ag3CWqOUYW+WZrbRmQxuPJdmYdcwUhN J1sv1yL2GBlUTGVp9x+5pLsEzTvDMCfynTgBR1l2VjU5WDuZkbddx4sAoAmILpVGd1XqJX 0pRhCH/4xLlJjOjPYyBAA2zFwl/8PR38Z1bn4V4eVYc+FroaXMbEfHP1M/Pubw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=H02KXOJa; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 974653A80A for ; Fri, 12 Jul 2024 19:24:16 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sSK09-0007Ni-Vo; Fri, 12 Jul 2024 13:24:10 -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 1sSK05-0007Fi-C7 for guix-patches@gnu.org; Fri, 12 Jul 2024 13:24:06 -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 1sSK05-0004TI-3P; Fri, 12 Jul 2024 13:24:05 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sSK02-0007Yl-O3; Fri, 12 Jul 2024 13:24:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#71697] [PATCH v4 2/2] scripts: lint: Honor package property to exclude checkers. 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, zimon.toutoune@gmail.com, me@tobias.gr, guix-patches@gnu.org Resent-Date: Fri, 12 Jul 2024 17:24: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 , 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 , Simon Tournier , Tobias Geerinckx-Rice Received: via spool by 71697-submit@debbugs.gnu.org id=B71697.172080501428975 (code B ref 71697); Fri, 12 Jul 2024 17:24:02 +0000 Received: (at 71697) by debbugs.gnu.org; 12 Jul 2024 17:23:34 +0000 Received: from localhost ([127.0.0.1]:54713 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sSJzZ-0007XC-IL for submit@debbugs.gnu.org; Fri, 12 Jul 2024 13:23:33 -0400 Received: from mail-wr1-f43.google.com ([209.85.221.43]:39954) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sSJzW-0007Wk-Oz for 71697@debbugs.gnu.org; Fri, 12 Jul 2024 13:23:32 -0400 Received: by mail-wr1-f43.google.com with SMTP id ffacd0b85a97d-3678ff89323so135917f8f.0 for <71697@debbugs.gnu.org>; Fri, 12 Jul 2024 10:23:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720804943; x=1721409743; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=2gv+7f0rQwUo/1QWLs1vGfa+kqapI6Hu14gCpNPYs6s=; b=H02KXOJaWH52CxLZH0UTSvvmU8jCMS9pRnd2ck+ffnt6SuXrcz3plpVIWPbLm4qtUy 75uzJI4qCTNsHaMxFWJJVG/BWx5N2TmB64EQldcTmbYMMvJq8Q2yWQhPxMVXf+gZkyIH DQMApDrsSNlVDo5Y9MSiXA/AnWb3lOUebxJu5tIitliS4v/YvJ3zl3pI3TrV4KiB32H3 mYT5z8aqk81Sf0LrypdWkhm0J7pOGfpXiYPlMGRpZhvV90Ucg3UHtX87XlTDQk8Kf5yn N64ScYN5ek42NULhmLGX1lha62HNrIX2i5Z73IAT5OcRO+ACa2nqGVs9t+S8aCQky0fQ yQIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720804943; x=1721409743; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2gv+7f0rQwUo/1QWLs1vGfa+kqapI6Hu14gCpNPYs6s=; b=VqCDcpJH8QmRj7pepvdEcT6neQZ4TDdf0IyWiYLCxGkSoGTpBrvbQx+9xeeVhEhYBe V97cOzlgbLlPZvf1GN21oTfBKCEjpxtY1Cj/idE7Lvn7f7uaPi10Oa52imTbBhm1QGZg wh93Eniyhm4JMJq6c2K2qa2IlH/v5caRnQgSXP7XJU3dr8r8Ju/zsJXf7a+pA0uNtYM+ Yb4/l6hfdqQF04hDgeKw6YS0AxkqsQZt4cmMZzJGr9qpfhuYLwHRFp7RcP8tzL6TZCvI 9IG4f2KoFlhwz88qCbPakqvZQSefDrj7/iNuth2k1Ipc3PqEhLqX/J/XLEz6lkzO/c7W +8aQ== X-Gm-Message-State: AOJu0YxrhJZT6O+kqFwkCyF8xTqRlAgokxffUWPOZ2OSw55gN+vApMUN lYOkqDjibPX8QfN8s0wLLRV5f1oSOdJGP9ePcWA9JOj58xvLKIlQl53YEA== X-Google-Smtp-Source: AGHT+IFsraEqibalargG9swaBvnlS0smSvRgD+zY2uFHs3+rtaCaYDP+k3hTb841YE7PeXathxW0Mw== X-Received: by 2002:a05:600c:4450:b0:426:6358:7c5d with SMTP id 5b1f17b1804b1-4279835bcc7mr35780805e9.4.1720804943361; Fri, 12 Jul 2024 10:22:23 -0700 (PDT) Received: from lili.univ-paris-diderot.fr (roam-nat-fw-prg-194-254-61-41.net.univ-paris-diderot.fr. [194.254.61.41]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4279f288c3fsm28943435e9.29.2024.07.12.10.22.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Jul 2024 10:22:23 -0700 (PDT) From: Simon Tournier Date: Fri, 12 Jul 2024 19:22:13 +0200 Message-ID: <30bba4961b5652378ecdb89e3f44bb136ee77dc8.1720804839.git.zimon.toutoune@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <9971c126670cd0f49a647d538aaf206d5b963322.1720804839.git.zimon.toutoune@gmail.com> References: <9971c126670cd0f49a647d538aaf206d5b963322.1720804839.git.zimon.toutoune@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -0.80 X-Spam-Score: -0.80 X-Migadu-Queue-Id: 974653A80A X-Migadu-Scanner: mx11.migadu.com X-TUID: GXaGdbtLZmdJ * guix/scripts/lint.scm (exclude-package-checkers): New procedure, remove the checker if the package is marked. (run-checkers, guix-lint): Use it. * doc/guix.texi: Document 'lint-excluded-checkers' package property. Change-Id: Idf8e5c67102a1701ebd917bbc6212cfeb6ea2054 --- doc/guix.texi | 16 +++++++++++++++- guix/scripts/lint.scm | 17 ++++++++++++++--- 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 6043962038..0558532077 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@* @@ -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 diff --git a/guix/scripts/lint.scm b/guix/scripts/lint.scm index 1b13d6e17f..ca1864b459 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. @@ -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))))) @@ -228,7 +238,8 @@ (define-command (guix-lint . args) (package-name package) (package-version package) (sort (map (compose symbol->string lint-checker-name) - checkers) + (exclude-package-checkers + package checkers)) string