From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id gFTcNVh2Vl8uVQAA0tVLHw (envelope-from ) for ; Mon, 07 Sep 2020 18:05:12 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id gLy5MVh2Vl/HGQAAB5/wlQ (envelope-from ) for ; Mon, 07 Sep 2020 18:05:12 +0000 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 4EEA19402A0 for ; Mon, 7 Sep 2020 18:05:12 +0000 (UTC) Received: from localhost ([::1]:45372 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kFLVv-0003h6-95 for larch@yhetil.org; Mon, 07 Sep 2020 14:05:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38704) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kFLVn-0003eh-1r for guix-patches@gnu.org; Mon, 07 Sep 2020 14:05:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:39240) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kFLVm-0002N9-Nk for guix-patches@gnu.org; Mon, 07 Sep 2020 14:05:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kFLVm-0001NS-JR for guix-patches@gnu.org; Mon, 07 Sep 2020 14:05:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#43261] [PATCH 1/2] lint: Fix '--no-network' option. References: <20200907180229.29475-1-zimon.toutoune@gmail.com> In-Reply-To: <20200907180229.29475-1-zimon.toutoune@gmail.com> Resent-From: zimoun Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 07 Sep 2020 18:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43261 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 43261@debbugs.gnu.org Cc: zimoun Received: via spool by 43261-submit@debbugs.gnu.org id=B43261.15995018675238 (code B ref 43261); Mon, 07 Sep 2020 18:05:02 +0000 Received: (at 43261) by debbugs.gnu.org; 7 Sep 2020 18:04:27 +0000 Received: from localhost ([127.0.0.1]:50784 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kFLVD-0001MQ-6e for submit@debbugs.gnu.org; Mon, 07 Sep 2020 14:04:27 -0400 Received: from mail-wr1-f51.google.com ([209.85.221.51]:46949) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kFLVA-0001M6-8m for 43261@debbugs.gnu.org; Mon, 07 Sep 2020 14:04:25 -0400 Received: by mail-wr1-f51.google.com with SMTP id o5so16584409wrn.13 for <43261@debbugs.gnu.org>; Mon, 07 Sep 2020 11:04:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=TqJpf9ZCl7ZusvCtIL8lnD8WVlsfz9Wzym0ncMqmpW8=; b=RjkqbHTpi4BSHW37RHplcsBUmDCQCnYPUVh4Vmx5HVHdFxU4RtGg2vYa9AnHJNdqAX Eo5vIjLZw27hQ4k+Qe2jzTcz9NtmOotb9Vt98tJhtsg3KCPhZ5fynJ9dy2kFE8xpiiW0 ShAsu8SLJECoaLKuQv4WQ1pcZ5PFG6X2Iwishm9nmTIuSTpcwFsUreqPYqxIalpfSM2B AGfc4MwEoHNyhzQVsQAvQgPsHCnafhZWXtTZRN8wbWJO6gW4gXxYYytXdPHrtwk5F71g XhpNwXu/Kr0Yee7if5Fk7d4Sr7neYAe7Qq92yDi4P01y3L4zNlGPBd2RgT/4ObNVJlXY YLtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=TqJpf9ZCl7ZusvCtIL8lnD8WVlsfz9Wzym0ncMqmpW8=; b=HCU7A9N5tl2qWI4FyJja6SqHJyf0hhIVD1wDBNncl0wrgjYab7hYD/Yz2bA0XLZ/ut oexrR/HaiItn+BpAKrukJnRFbZhbU4TCkbgmMtoX/EtrhSJ1I/IUJNx7Tzf1Wf8lVt0W gv1z7oVLUogCHYvABIytggPFybbQ3HhaWrcC4OAaDqTgh1IDkKnCoZwXsI9Rgi+0dN4b bU2LVS67F+mvZ6CBCiXJceDTEtWsvuLmY1EdKdPzOyK0JNhOZuqmFOcvIr870Gqf6lwT TaGP69l3QfYN/vEW8MgXqgr60/Bm9OvZnUmDz7ncT1ehRCteeAg3qOFzyUIQ0KGs66al FFoQ== X-Gm-Message-State: AOAM530C4A7bcdeUDnJOpmaL8cKM9pipMKmF1Q2eyRtCAsFmYNZVlp0y Y3PbFaFx0HuLZhCnJAMuf+WO5Mxnob4= X-Google-Smtp-Source: ABdhPJxvekgFiJpDffGZ5J8aN0w2x88f4M+bCwrZpXaajzraokhTaBAaZzlaEV0QViBxOpSlOrABkg== X-Received: by 2002:a5d:69c2:: with SMTP id s2mr22797082wrw.389.1599501858058; Mon, 07 Sep 2020 11:04:18 -0700 (PDT) Received: from pfiuh02.univ-paris-diderot.fr ([193.48.40.241]) by smtp.gmail.com with ESMTPSA id u126sm35778838wmu.9.2020.09.07.11.04.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Sep 2020 11:04:17 -0700 (PDT) From: zimoun Date: Mon, 7 Sep 2020 20:04:14 +0200 Message-Id: <20200907180415.30140-1-zimon.toutoune@gmail.com> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -1.0 (-) 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" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=fail (rsa verify failed) header.d=gmail.com header.s=20161025 header.b=RjkqbHTp; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Spam-Score: 0.09 X-TUID: KI7cL7LlRh8R * guix/scripts/lint.scm: (show-help): Add '--no-network' option message. (%options, parse-options): Fix argument order. * doc/guix.texi: Document it. --- doc/guix.texi | 4 ++++ guix/scripts/lint.scm | 18 ++++++++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index f224e356bc..ea2aa1581e 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -10632,6 +10632,10 @@ and exit. Only enable the checkers specified in a comma-separated list using the names returned by @option{--list-checkers}. +@item --no-network +@itemx -n +Only enable the checkers which do not dependent on Internet access. + @item --load-path=@var{directory} @itemx -L @var{directory} Add @var{directory} to the front of the package module search path diff --git a/guix/scripts/lint.scm b/guix/scripts/lint.scm index 5168a1ca17..c56576fcbd 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 Simon Tournier +;;; Copyright © 2019, 2020 Simon Tournier ;;; ;;; This file is part of GNU Guix. ;;; @@ -98,6 +98,9 @@ run the checkers on all packages.\n")) (display (G_ " -c, --checkers=CHECKER1,CHECKER2... only run the specified checkers")) + (display (G_ " + -n, --no-network only run checkers which do not access to network")) + (display (G_ " -L, --load-path=DIR prepend DIR to the package module search path")) (newline) @@ -132,10 +135,7 @@ run the checkers on all packages.\n")) result)))) (option '(#\n "no-network") #f #f (lambda (opt name arg result) - (alist-cons 'checkers - %local-checkers - (alist-delete 'checkers - result)))) + (alist-cons 'no-network? #t result))) (find (lambda (option) (member "load-path" (option-names option))) %standard-build-options) @@ -169,7 +169,13 @@ run the checkers on all packages.\n")) value) (_ #f)) (reverse opts))) - (checkers (or (assoc-ref opts 'checkers) %all-checkers))) + (the-checkers (or (assoc-ref opts 'checkers) %all-checkers)) + (checkers + (if (assoc-ref opts 'no-network?) + (filter (lambda (checker) + (member checker %local-checkers)) + the-checkers) + the-checkers))) (when (assoc-ref opts 'list?) (list-checkers-and-exit checkers)) -- 2.28.0