From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 28 12:51:29 2020 Received: (at 43261) by debbugs.gnu.org; 28 Oct 2020 16:51:29 +0000 Received: from localhost ([127.0.0.1]:50387 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kXofZ-0004yz-3x for submit@debbugs.gnu.org; Wed, 28 Oct 2020 12:51:29 -0400 Received: from mail-wr1-f47.google.com ([209.85.221.47]:33037) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kXofW-0004yd-U7 for 43261@debbugs.gnu.org; Wed, 28 Oct 2020 12:51:28 -0400 Received: by mail-wr1-f47.google.com with SMTP id b8so6488258wrn.0 for <43261@debbugs.gnu.org>; Wed, 28 Oct 2020 09:51:26 -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=cHH8s23wTNCPGK2CbwHM4rOyLtc7Hm8Pz25od2Hcdk4=; b=WPD8gjp01v3qSyLchrFQgYyAUUk3K2h94pCMmaCvLLUsmRdWsgEXeJiECIrixDxbaa OxJRpsYu5A7AbSPxJPb3aMDCHgWnUwYZA94tipPAn/ATkk5Vs6dlk7ok5oAY6TSvs3s9 ho3OReYjnbv1wWYDJTk1Pa2aVX2Y5WhlZszIyH/4Slx2JeDdwtaB7JeLamalEYQbis3N AciXPa3f1d42ohvqy3ZfKhic1pRSPJ+By9CI7LIUmdiko7UkHWZISEBLbii47YqYn4hh o++9/ARghNRDnsEpIAxmcr9jU4Wq4b/BXghxf+yI0Gprzz0I+bSxOeuh+oLBAX9CWTfX tZSw== 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=cHH8s23wTNCPGK2CbwHM4rOyLtc7Hm8Pz25od2Hcdk4=; b=Km+262Eb1G5ohcRv399v2i86Krs7fJIGmEnK7aOmjIiMVi/WIbvJpfPGgfphs7Ab7P hFvzSQBxL833/tLsrsQ1lH+44w4Abcp1JkKQ7C0ZVtao5radVQLPqED5yoXg6hBnyq6O Vg+85lv2sWFZpruvtVnpY1hakIaaJBW+COYRj4dGFvn/TtD3sZ1Pn+4ZbnK7+D1zRSCx 3t4NsZiy1CzxILEjNabvd+lx06g8ordwH8ubZxqaqCSTRc2XQl2SK7U4w2CTOuO9SJ9m pbqy2SpFjVtfF9czCjAeP8IxIx1ogrCC90QsbEEfK/xgyBQYDh8X1qk2Ob3O6UzzjTza gPJg== X-Gm-Message-State: AOAM531wGWd80ILPSX/oW1fhtzu5Esz5M6pDmHkMARQv6GCwZTLru2eV DEBy1DYXHspZ4sNXYJvwxXp4sRmy3BU= X-Google-Smtp-Source: ABdhPJz9zZLcEuzOCMRKbT1AkzGtiKnIoA6uj6tw7HwEV0w/4W3JJWgW8BoFeGncClILUvj5mMe1rg== X-Received: by 2002:a5d:490a:: with SMTP id x10mr157229wrq.289.1603903880753; Wed, 28 Oct 2020 09:51:20 -0700 (PDT) Received: from lili.univ-paris-diderot.fr ([2a01:e0a:59b:9120:65d2:2476:f637:db1e]) by smtp.gmail.com with ESMTPSA id y206sm221247wmd.34.2020.10.28.09.51.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Oct 2020 09:51:20 -0700 (PDT) From: zimoun To: 43261@debbugs.gnu.org Subject: [PATCH v2 1/2] scripts: lint: Fix '--no-network' option. Date: Wed, 28 Oct 2020 17:51:11 +0100 Message-Id: <20201028165112.28575-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-Debbugs-Envelope-To: 43261 Cc: ludo@gnu.org, zimoun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * guix/scripts/lint.scm: (show-help): Add '--no-network' option message. (%options, parse-options): Fix argument order. * doc/guix.texi (Invoking guix lint): 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 22bddf10e3..19cf26572c 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -11528,6 +11528,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 979d4f8363..1ab563a3fa 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) @@ -172,7 +172,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)) base-commit: d22d129da903cf6c3382cff5226d81a881fed2aa -- 2.28.0