From patchwork Sat Jun 22 15:27:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Tournier X-Patchwork-Id: 28625 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 1DD7527BBEA; Sat, 22 Jun 2024 16:29:30 +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 64BE127BBE2 for ; Sat, 22 Jun 2024 16:29:29 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sL2fv-0004qw-Jj; Sat, 22 Jun 2024 11:29: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 1sL2ft-0004qd-9b for guix-patches@gnu.org; Sat, 22 Jun 2024 11:29:09 -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 1sL2ft-0002Yh-1p; Sat, 22 Jun 2024 11:29:09 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sL2fl-0000wb-Mg; Sat, 22 Jun 2024 11:29:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#71697] [PATCH v3 1/2] scripts: lint: Add 'dry-run' option. 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: Sat, 22 Jun 2024 15:29:01 +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.17190701013531 (code B ref 71697); Sat, 22 Jun 2024 15:29:01 +0000 Received: (at 71697) by debbugs.gnu.org; 22 Jun 2024 15:28:21 +0000 Received: from localhost ([127.0.0.1]:49743 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sL2f6-0000ut-Ms for submit@debbugs.gnu.org; Sat, 22 Jun 2024 11:28:21 -0400 Received: from mail-wm1-f50.google.com ([209.85.128.50]:39218) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sL2f5-0000uW-1f for 71697@debbugs.gnu.org; Sat, 22 Jun 2024 11:28:19 -0400 Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-42181803bf2so4437935e9.1 for <71697@debbugs.gnu.org>; Sat, 22 Jun 2024 08:28:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719070033; x=1719674833; 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=iTeAICyrNsT46JmUSzzy/T6nLJzSjmnRRhRRrPI9P+s=; b=BDCUbEucdUYeN1/ZkizA3JP0J63XFooiksXGjd37FxCZlEsL39JqdKk0CrHVvTqtpe cxteRHaaKBHJy7jvuPO2cc72da6UEM6jlqsOWia3nItf+y2IrJDl8SeUTOaCwfiR6epz b0SGVjTC8UIrQBXi9fzUrLkWhF2DgyDBE07f0ltjGWKAzbE0QLvZtpJkjz+Tony4heSa jBEitKcaYD+jqyE8VqE/MT2MtCFlveHkB/9pKlGCP/OHtp428Ujn/9tzT7M6l5tfhECe 1ev6J6tuTcz18J9YUvmoUqBsJ2q5MzCHorcI1tJiX90sCPCgVrUbzXMUJiHz97uSGgkX LEJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719070033; x=1719674833; 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=iTeAICyrNsT46JmUSzzy/T6nLJzSjmnRRhRRrPI9P+s=; b=dhPItfyVgeUHZ2nq2/Rb8ASfEmJeJbF8/9XjCJa7DrsUwr3LAvhYIQNF0pyO7ozphy KN4K5vylSPaQl+r3nSmVvz/O1V1184DyIbGtRJDqAfxUfCeEWcMiLFBxIMq2Itb07X3r xHIlFVLsvHxZYTM+F9oaYXTG6z6114OTzqd/20uexw6qUZnCk21Yz1vK88kTCjmILbI0 FBPLSOPmHRX1Al0Ewhc3KPIYRjn6tZEoAdJW/n3xvyNUIgICZCTmxu4NxdqAJXHnxCVU dqLmGnJM8rsqN8wNB5M1Cs+adEklpT9XoL32MoMzjRkWc47CXmlm1IE6lHuGfGzYmqxi J4NA== X-Gm-Message-State: AOJu0YzH1Tz0mgPqKuhrHcNzqiiwij/JifQ4/0dkKel8znq6XJxZQl67 bi0SORUPVSe8olMUlePPRnnVs4ZPilc5i6aE0oYQ4+is68IEl6w4F9oX4Q== X-Google-Smtp-Source: AGHT+IGzItJaN+OqeWcvkDiwGWXHLlZunV7eYia2T6qrlDN+/j4IYRfvZIIxkUsF4NGZZuHtkfDJ+Q== X-Received: by 2002:a05:6000:18ae:b0:35f:2929:846e with SMTP id ffacd0b85a97d-366e2a0a8eemr1015226f8f.1.1719070033018; Sat, 22 Jun 2024 08:27:13 -0700 (PDT) Received: from lili.. ([2a01:e0a:59b:9120:cf36:ad5d:499d:a92]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-366383f6dc7sm4763294f8f.14.2024.06.22.08.27.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 22 Jun 2024 08:27:12 -0700 (PDT) From: Simon Tournier Date: Sat, 22 Jun 2024 17:27:07 +0200 Message-ID: <1f9e0a732fff5c6460e6da9500ea5b748882e38d.1719069966.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 (show-help, %options): Add 'dry-run' option. (guix-lint): Use it. * doc/guix.texi: Document it. Change-Id: I8c96e376d52c0961ccf2ab39f1fc856c762b089d --- doc/guix.texi | 3 +++ guix/scripts/lint.scm | 16 ++++++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) base-commit: bc8a41f4a8d9f1f0525d7bc97c67ed3c8aea3111 diff --git a/doc/guix.texi b/doc/guix.texi index 769ca1399f..037b1a2f24 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -15459,6 +15459,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..b98266c831 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) @@ -222,10 +227,13 @@ (define-command (guix-lint . args) (lambda (store) (cond ((null? args) - (fold-packages (lambda (p r) (run-checkers p checkers - #:store store)) '())) + (fold-packages (lambda (p r) + (when (not (assoc-ref opts 'dry-run?)) + (run-checkers p checkers + #:store store))) '())) (else (for-each (lambda (package) - (run-checkers package checkers - #:store store)) + (when (not (assoc-ref opts 'dry-run?)) + (run-checkers package checkers + #:store store))) args)))))))))