From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id GGdbGyOzmmZi/AAA62LTzQ:P1 (envelope-from ) for ; Fri, 19 Jul 2024 18:40:35 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id GGdbGyOzmmZi/AAA62LTzQ (envelope-from ) for ; Fri, 19 Jul 2024 20:40:35 +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=CRLDa6NG; 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"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1721414435; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: 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=Pp0PurRNNpQ2QH8WxnFjzj2bl8wcDYkfZiT4CBoogTo=; b=IKwRRGuh0bH4S37nfUt7aSK1c5cgIho5ZSHlbKt84jOjbKZ/kZr6nJwLhgCEWWaAFRB1Y5 MgEoGPIMbDkbYg9hRvXaXRfxXw2AgYNO2Bub0Pcf0Hl3hu+GPhuGugoVQkLOv+KMHQoSue yKYaqByNuJZru765Hn6aaoUiCtqVGhXnw4Fc8wJKxnhvRcow2jcWohSYD/3uzm55yRuSHY 9rtZ2pKX51tqGF9Ijf6DUa8kOZP46nG55INy0DxRWknpsVKnGLyaRWw53/aA8PMykH42vI bID7UfxH5GDZkEnbpq0jzY4Jz1b3NweUx2TMWrjuvWcJEt2eJSkgfEaPE5VQ5w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=CRLDa6NG; 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"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Seal: i=1; s=key1; d=yhetil.org; t=1721414435; a=rsa-sha256; cv=none; b=WrOidIbSmXX/ZW0vZnSirUImVxVV4uQDWwCNQfaUeeswGYNURSFw8H4VYHE+mgYtH2OCU9 rBim71PM3kEC9j188VPZK7tHVwsQgBRCaDtvQhEkoc75GA8p9mqi/HTvuPQJ35RjY9nifA FPztHwFFXIVA6nHAEI6SG8UCDmPKPVl6zEQLJ7uGaBThWmfq/6gChT8KKnCLiPgGy9k3OZ ElRjLBQGlR7iNaANAJeDzqDo8x+FxpPYBFIOFNF/Q1BPTf7NofGJhROLBwqECfqGktsHCP hgPQFJ17prdRKT4vRtSxTs8OjcEoHj4SymGdpCFNdQRrirmyKebSDjD2j+7Fgw== 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 2E36C5142C for ; Fri, 19 Jul 2024 20:40:34 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sUsWZ-0000Xw-Rl; Fri, 19 Jul 2024 14:40:11 -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 1sUsWY-0000TV-Ls for guix-patches@gnu.org; Fri, 19 Jul 2024 14:40:10 -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 1sUsWY-00034x-9w; Fri, 19 Jul 2024 14:40:10 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sUsWQ-0006ch-D2; Fri, 19 Jul 2024 14:40:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#71697] [PATCH v5 1/3] scripts: lint: Add 'dry-run' option. 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, 19 Jul 2024 18:40: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: Simon Tournier , Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: Josselin Poiret , Maxim Cournoyer , Mathieu Othacehe , Tobias Geerinckx-Rice , Florian Pelz , 71697@debbugs.gnu.org, Christopher Baines , Matthew Trzcinski , 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.172141437525387 (code B ref 71697); Fri, 19 Jul 2024 18:40:02 +0000 Received: (at 71697) by debbugs.gnu.org; 19 Jul 2024 18:39:35 +0000 Received: from localhost ([127.0.0.1]:50872 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sUsVz-0006bO-6A for submit@debbugs.gnu.org; Fri, 19 Jul 2024 14:39:35 -0400 Received: from mail-wr1-f53.google.com ([209.85.221.53]:38257) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sUsVx-0006bB-4u for 71697@debbugs.gnu.org; Fri, 19 Jul 2024 14:39:33 -0400 Received: by mail-wr1-f53.google.com with SMTP id ffacd0b85a97d-36874d7f70bso137530f8f.1 for <71697@debbugs.gnu.org>; Fri, 19 Jul 2024 11:39:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721414308; x=1722019108; 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=Pp0PurRNNpQ2QH8WxnFjzj2bl8wcDYkfZiT4CBoogTo=; b=CRLDa6NGSYz3FGQclsikDGTW4fSK12lJ47Sw8obhOVMW+Yu1FxCwei7bclDoAcz9H/ rxiRPiilK/ec8Z6Huaz8D9Az0HoFbY0V9yT/sEy/OR7JTn1NJji99QEZvm4JKoF57xqX iYhgNaFC49alBpoj4HlIWEv4I2fs2FJIHH5VFYKhjResiMLF3kAq3FY5CAUcZMnhaZk6 58zGHZvfbEGGmxtonBM6xSI1vvyjFcuesyKsMb+HBB4eUYMFYTZpz7HgqjLtM8z4U6Yx RJdVM+qZZny+b04vVNxhgjxM8urLV0o3E7/3laZZBUv5Z4rSL612qZM9CnvzAPv0918o ry2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721414308; x=1722019108; 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=Pp0PurRNNpQ2QH8WxnFjzj2bl8wcDYkfZiT4CBoogTo=; b=r1nimXdByOh1YS8XK0UVtdjgzeIyv2AvelbCOV1cWKWkzHbVz2uzHHkgjnLfenQ/TW 0OnxjLq+zvYhRGO11dQzwWUa0xF/AcT4iVZKYx8BP+kth6KIB6wJeBqALDOV80s6rU6e PVgqJTf+hndlQ8cdljan0ZSEyviD2nw7AfcUj0kRuQ4WrzNzlXWbBwaxQeDr5R8GV9W2 FQEbAMUd7IALCRzqegM0Eex/Cc+fYqzvngupLPee80bpKtA87s+y3vQHJ9gvFEmpBOf3 PHnZSoKZa/GmZckZLrKUiU2Z0raRna6r9ElVlIg5tFLGZNy6nVDqM4/G10ei5bOpVo+n k7PA== X-Forwarded-Encrypted: i=1; AJvYcCX6PNpIJmB8dGvSUqa9TnGzKxoRj7Ziadz4eyctn7LJKmwm3RPllvWWhMUsQzqY9vgw6bPSPfPFaTj74f+zFDmfKwc9GSw= X-Gm-Message-State: AOJu0Yzd0QQuaproswHIwQ+7qbtEdFp4yaOim1+MAB9nPFsplb1jju9M UPbDGfm2dCy0OVrEefa6jI8rF5xfqJnaAWxsA/pcEr4f/gSHWXMh X-Google-Smtp-Source: AGHT+IFcGaW9cefsVTD8Mc9xDb3LbhcedQYcLNdhLx1O5FLifzydA9+21D+3tptmInZ6NxyIus2TdA== X-Received: by 2002:a05:600c:3554:b0:426:6cd1:d104 with SMTP id 5b1f17b1804b1-427daa7be1amr1292545e9.4.1721414307827; Fri, 19 Jul 2024 11:38:27 -0700 (PDT) Received: from lili.univ-paris-diderot.fr (roam-nat-fw-prg-194-254-61-42.net.univ-paris-diderot.fr. [194.254.61.42]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-427d2a8e42bsm62855355e9.30.2024.07.19.11.38.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jul 2024 11:38:27 -0700 (PDT) From: Simon Tournier Date: Fri, 19 Jul 2024 20:38:08 +0200 Message-ID: <29595ae1ec166885b3916f9239986da5a7fdad58.1721411923.git.zimon.toutoune@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 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-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Queue-Id: 2E36C5142C X-Migadu-Scanner: mx13.migadu.com X-Migadu-Spam-Score: -3.31 X-Spam-Score: -3.31 X-TUID: +PDQb7szhhs/ * guix/scripts/lint.scm (guix-lint)[show-package-checkers]: New procedure. (show-help, %options): Add 'dry-run' option. * doc/guix.texi: Document it. Change-Id: I8c96e376d52c0961ccf2ab39f1fc856c762b089d --- doc/guix.texi | 3 +++ guix/scripts/lint.scm | 54 +++++++++++++++++++++++++++++++++++++++---- 2 files changed, 53 insertions(+), 4 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 5b77c84b4a..6043962038 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -15463,6 +15463,9 @@ Invoking guix lint List and describe all the available checkers that will be run on packages and exit. +@item --dry-run +Do not run the checkers. + @item --checkers @itemx -c Only enable the checkers specified in a comma-separated list using the diff --git a/guix/scripts/lint.scm b/guix/scripts/lint.scm index ee3de51fb1..10abb05cf0 100644 --- a/guix/scripts/lint.scm +++ b/guix/scripts/lint.scm @@ -100,6 +100,8 @@ (define (show-help) (display (G_ "Usage: guix lint [OPTION]... [PACKAGE]... Run a set of checkers on the specified package; if none is specified, run the checkers on all packages.\n")) + (display (G_ " + --dry-run do not run checkers ")) (display (G_ " -c, --checkers=CHECKER1,CHECKER2... only run the specified checkers")) @@ -154,6 +156,9 @@ (define %options (option '(#\n "no-network") #f #f (lambda (opt name arg result) (alist-cons 'no-network? #t result))) + (option '("dry-run") #f #f + (lambda (opt name arg result) + (alist-cons 'dry-run? #t result))) (find (lambda (option) (member "load-path" (option-names option))) %standard-build-options) @@ -218,14 +223,55 @@ (define-command (guix-lint . args) (proc store)) (proc #f))) + (define (show-package-checkers package checkers) + (let* ((name (package-name package)) + (version (package-version package)) + (loc (package-location package)) + (number-checkers (length checkers)) + (number-all-checkers (length %all-checkers))) + (cond + ((= number-all-checkers number-checkers) + (info loc (G_ "~a@~a: all the ~d checkers would run.~%") + name version + number-all-checkers)) + ((= 0 number-checkers) + (info loc (G_ "~a@~a: none of ~d checkers would run~%") + name version + number-all-checkers)) + (else + (let* ((excluded-checkers (lset-difference eq? %all-checkers checkers)) + (number-excluded-checkers (length excluded-checkers)) + (number-difference (- number-all-checkers number-excluded-checkers)) + (sorter (lambda (list-checkers) + (sort (map (compose symbol->string lint-checker-name) + list-checkers) + string