Skip to content

Commit

Permalink
fix(emacs): don't log blank messages
Browse files Browse the repository at this point in the history
Every time Flymake runs quick-lint-js, a "" message is logged. This is
because the plugin logs stderr, but most of the time, stderr is empty.

Fix the noisy logs by only logging if stderr is non-empty.
  • Loading branch information
strager committed Oct 19, 2023
1 parent 8139e0a commit 05a4d14
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions plugin/emacs/flymake-quicklintjs.el
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,10 @@ REPORT-FN is Flymake's callback."
(when (and (eq 'exit (process-status p))
(eq p flymake-quicklintjs--proc))
(with-current-buffer stderr-buf
(flymake-log :warning "%S"
(buffer-substring-no-properties
(point-min) (point-max))))
(let ((stderr-data (buffer-substring-no-properties
(point-min) (point-max))))
(if (not (string-empty-p stderr-data))
(flymake-log :warning "%S" stderr-data))))
(with-current-buffer stdout-buf
(let ((diags (flymake-quicklintjs--make-diagnostics
src-buf
Expand Down

0 comments on commit 05a4d14

Please sign in to comment.