GNU bug report logs -
#43261
[PATCH 0/2] lint: Fix 'no-network' and add 'no-checkers' options
Previous Next
Reported by: zimoun <zimon.toutoune <at> gmail.com>
Date: Mon, 7 Sep 2020 18:03:02 UTC
Severity: normal
Tags: patch
Done: Ludovic Courtès <ludo <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
* 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 <me <at> tobias.gr>
;;; Copyright © 2017, 2018 Efraim Flashner <efraim <at> flashner.co.il>
;;; Copyright © 2018, 2019 Arun Isaac <arunisaac <at> systemreboot.net>
-;;; Copyright © 2019 Simon Tournier <zimon.toutoune <at> gmail.com>
+;;; Copyright © 2019, 2020 Simon Tournier <zimon.toutoune <at> gmail.com>
;;;
;;; 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
This bug report was last modified 4 years and 263 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.