~ruther/guix-local

b002e9d08eb909e9fa1a84b0feed1662dce0bd3f — Ludovic Courtès 11 years ago 52bd081
guix lint: Remove "guix lint: " prefix from warnings.

This allows editors to parse warnings correctly.

* guix/scripts/lint.scm (emit-warning): Use 'format' instead of
  'warning', to avoid the "guix lint: " prefix in messages.
* tests/lint.scm (call-with-warnings): Indent.
2 files changed, 8 insertions(+), 8 deletions(-)

M guix/scripts/lint.scm
M tests/lint.scm
M guix/scripts/lint.scm => guix/scripts/lint.scm +4 -4
@@ 81,10 81,10 @@ Run a set of checkers on the specified package; if none is specified, run the ch
  ;; provided MESSAGE.
  (let ((loc (or (package-field-location package field)
                 (package-location package))))
    (warning (_ "~a: ~a: ~a~%")
             (location->string loc)
             (package-full-name package)
             message)))
    (format (guix-warning-port) (_ "~a: ~a: ~a~%")
            (location->string loc)
            (package-full-name package)
            message)))


;;;

M tests/lint.scm => tests/lint.scm +4 -4
@@ 39,10 39,10 @@
           (home-page #f) (license #f) ))

(define (call-with-warnings thunk)
       (let ((port (open-output-string)))
         (parameterize ((guix-warning-port port))
           (thunk))
         (get-output-string port)))
  (let ((port (open-output-string)))
    (parameterize ((guix-warning-port port))
      (thunk))
    (get-output-string port)))

(test-assert "synopsis: ends with a period"
  (->bool