Skip to content

Commit

Permalink
Avoid printing double lines in GitHub Actions
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
snogge committed Mar 28, 2024
1 parent 0868e7a commit d990a98
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions buttercup.el
Original file line number Diff line number Diff line change
Expand Up @@ -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))))))

Expand Down

0 comments on commit d990a98

Please sign in to comment.