Subject: bug#40367: closed (Re: [bug#40367] [PATCH v3] lint: Display result of checkers on stdout.)

From: [email-masked] (GNU bug Tracking System)
Date: Sat, 21 Nov 2020 10:25:02 +0000

Your bug report

#40367: [PATCH] lint: Display result of checkers on stdout.

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
40367: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=40367
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: [bug#40367] [PATCH v3] lint: Display result of checkers on stdout.
From: Christopher Baines <[email-masked]>
To: Brice Waegeneire <[email-masked]>
Cc: [email-masked]
Date: Sat, 21 Nov 2020 10:24:36 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

Brice Waegeneire <[email-masked]> writes:

> * guix/scripts/lint.scm (emit-warnings): Use 'current-output-port'
> instead of 'current-error-port'.
> ---
>
> This version remove an extra space and correctly indent the patch.
>
>  guix/scripts/lint.scm | 15 ++++++++++-----
>  1 file changed, 10 insertions(+), 5 deletions(-)
>
> diff --git a/guix/scripts/lint.scm b/guix/scripts/lint.scm
> index 97ffd57301..5445645b53 100644
> --- a/guix/scripts/lint.scm
> +++ b/guix/scripts/lint.scm
> @@ -10,6 +10,7 @@
>  ;;; Copyright © 2017, 2018 Efraim Flashner <[email-masked]>
>  ;;; Copyright © 2018, 2019 Arun Isaac <[email-masked]>
>  ;;; Copyright © 2019 Simon Tournier <[email-masked]>
> +;;; Copyright © 2020 Brice Waegeneire <[email-masked]>
>  ;;;
>  ;;; This file is part of GNU Guix.
>  ;;;
> @@ -47,11 +48,15 @@
>    ;; 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))))
> +     (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)

Thanks, and apologies in the delay in looking at this again.

I've pushed it to master as becfa42ea79feb402fe6bc5922da2019ef021e88.q

Thanks again,

Chris

Subject: [PATCH] lint: Display result of checkers on stdout.
From: Brice Waegeneire <[email-masked]>
To: [email-masked]
Date: Wed, 1 Apr 2020 09:38:35 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

* 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 <[email-masked]>
 ;;; Copyright © 2018, 2019 Arun Isaac <[email-masked]>
 ;;; Copyright © 2019 Simon Tournier <[email-masked]>
+;;; Copyright © 2020 Brice Waegeneire <[email-masked]>
 ;;;
 ;;; 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