GNU bug report logs - #40367
[PATCH] lint: Display result of checkers on stdout.

Previous Next

Package: guix-patches;

Reported by: Brice Waegeneire <brice <at> waegenei.re>

Date: Wed, 1 Apr 2020 07:40:02 UTC

Severity: normal

Tags: patch

Done: Christopher Baines <mail <at> cbaines.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Brice Waegeneire <brice <at> waegenei.re>
To: 40367 <at> debbugs.gnu.org
Subject: [bug#40367] [PATCH v2] lint: Display result of checkers on stdout.
Date: Wed,  1 Apr 2020 15:19:25 +0200
* guix/scripts/lint.scm (emit-warnings): Use 'current-output-port'
instead of 'current-error-port'.
---

This version is rebased on top of master and only change the output port to
stdout for the result of the checkers, not for the progress or any run-time
errors.

 guix/scripts/lint.scm | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/guix/scripts/lint.scm b/guix/scripts/lint.scm
index 97ffd57301..28b4db656c 100644
--- a/guix/scripts/lint.scm
+++ b/guix/scripts/lint.scm
@@ -10,6 +10,7 @@
 ;;; 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 © 2020 Brice Waegeneire <brice <at> waegenei.re>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -46,13 +47,17 @@
   ;; given, the location of PACKAGE otherwise, the full name of PACKAGE and the
   ;; provided MESSAGE.
   (for-each
-   (lambda (lint-warning)
-     (let ((package (lint-warning-package lint-warning))
-           (loc     (lint-warning-location lint-warning)))
-       (info loc (G_ "~a@~a: ~a~%")
-             (package-name package) (package-version package)
-             (lint-warning-message lint-warning))))
-   warnings))
+     (lambda (lint-warning)
+       (let* ((package (lint-warning-package lint-warning))
+              (name (package-name package))
+              (version (package-version package))
+              (loc     (lint-warning-location lint-warning))
+              (message (lint-warning-message lint-warning)))
+         (parameterize
+             ((guix-warning-port (current-output-port)))
+            (info loc (G_ "~a@~a: ~a~%")
+                  name version message) )))
+     warnings))
 
 (define* (run-checkers package checkers #:key store)
   "Run the given CHECKERS on PACKAGE."
-- 
2.25.1





This bug report was last modified 4 years and 179 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.