From: Brice Waegeneire <brice@waegenei.re>
To: 40367@debbugs.gnu.org
Subject: [bug#40367] [PATCH] lint: Display result of checkers on stdout.
Date: Wed, 1 Apr 2020 09:38:35 +0200 [thread overview]
Message-ID: <20200401073835.5890-1-brice@waegenei.re> (raw)
* guix/scripts/lint.scm (run-checkers): Replace 'current-error-port' by
'current-output-port'.
---
guix/scripts/lint.scm | 29 ++++++++++++++++-------------
1 file changed, 16 insertions(+), 13 deletions(-)
diff --git a/guix/scripts/lint.scm b/guix/scripts/lint.scm
index 8d08c484f5..87705ef6d5 100644
--- a/guix/scripts/lint.scm
+++ b/guix/scripts/lint.scm
@@ -10,6 +10,7 @@
;;; Copyright © 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2018, 2019 Arun Isaac <arunisaac@systemreboot.net>
;;; Copyright © 2019 Simon Tournier <zimon.toutoune@gmail.com>
+;;; Copyright © 2020 Brice Waegeneire <brice@waegenei.re>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -55,19 +56,21 @@
(define (run-checkers package checkers)
"Run the given CHECKERS on PACKAGE."
- (let ((tty? (isatty? (current-error-port))))
- (for-each (lambda (checker)
- (when tty?
- (format (current-error-port) "checking ~a@~a [~a]...\x1b[K\r"
- (package-name package) (package-version package)
- (lint-checker-name checker))
- (force-output (current-error-port)))
- (emit-warnings
- ((lint-checker-check checker) package)))
- checkers)
- (when tty?
- (format (current-error-port) "\x1b[K")
- (force-output (current-error-port)))))
+ (parameterize
+ ((guix-warning-port (current-output-port)))
+ (let ((tty? (isatty? (current-output-port))))
+ (for-each (lambda (checker)
+ (when tty?
+ (format #t "checking ~a@~a [~a]...\x1b[K\r"
+ (package-name package) (package-version package)
+ (lint-checker-name checker))
+ (force-output))
+ (emit-warnings
+ ((lint-checker-check checker) package)))
+ checkers)
+ (when tty?
+ (format #t "\x1b[K")
+ (force-output)))))
(define (list-checkers-and-exit checkers)
;; Print information about all available checkers and exit.
--
2.25.1
next reply other threads:[~2020-04-01 7:40 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-01 7:38 Brice Waegeneire [this message]
2020-04-01 12:25 ` [bug#40367] [PATCH] lint: Display result of checkers on stdout Tobias Geerinckx-Rice via Guix-patches via
2020-04-01 13:21 ` Brice Waegeneire
2020-04-21 8:58 ` Brice Waegeneire
2020-04-01 13:19 ` [bug#40367] [PATCH v2] " Brice Waegeneire
2020-05-21 19:08 ` [bug#40367] [PATCH v3] " Brice Waegeneire
2020-11-21 10:24 ` bug#40367: " Christopher Baines
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200401073835.5890-1-brice@waegenei.re \
--to=brice@waegenei.re \
--cc=40367@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).