branch: elpa/buttercup
commit d990a98ac10adf5b04b76aa71a25afc5c8899744
Author: Ola Nilsson <[email protected]>
Commit: Ola Nilsson <[email protected]>
Avoid printing double lines in GitHub Actions
The "terminal" used in github action does not support the use of
carriage return '\r' to move back to column zero and overwrite the
line. Carriage return will instead move to the next line.
The consequence for the buttercup batch reporer was that each spec
description was printed twice, once without color before the spec was
run and once with color once the spec had run and the result was
known. Reuse the same mechanism as for specs with descriptions
containing newlines, don't print the spec description before running
it unless color is disabled.
Fixes #181.
---
buttercup.el | 1 +
1 file changed, 1 insertion(+)
diff --git a/buttercup.el b/buttercup.el
index 17f9cc8772..268f0a943b 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -1825,6 +1825,7 @@ Two special statuses can be listed in
(not (or buttercup-reporter-batch-quiet-statuses
;; Do not 'pre-print' in github actions unless color is
;; disabled. See #181.
+ (and (getenv "GITHUB_ACTION") buttercup-color)
(and buttercup-color
(string-match-p "[\n\v\f]" (buttercup-spec-description
spec))))))