Skip to content

Commit

Permalink
Strip out more ANSI color codes (#297)
Browse files Browse the repository at this point in the history
This should issues like
https://github.com/coq/coq/pull/18446/checks?check_run_id=20043646334
not finding `Error` since the introduction of colors in
coq/coq#18338. ANSI color codes sometimes
include three numeric components. If we want to be more precise, we
could use `([0-9]+;?){1,3}` or even `([0-9]+;){0,2}[0-9]+`, but I think
this might be overkill, and there's not too much harm in using the
simpler expression.
  • Loading branch information
JasonGross authored Jan 16, 2024
2 parents b8e9db5 + a3b153b commit 2957d1b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/actions.ml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ let send_status_check ~bot_info job_info ~pr_num (gh_owner, gh_repo)
in
let trace_lines =
trace
|> Str.global_replace (Str.regexp "\027\\[[0-9]*;[0-9]*m") ""
|> Str.global_replace (Str.regexp "\027\\[[0-9;]*m") ""
|> Str.global_replace (Str.regexp "\027\\[0K") ""
|> Str.global_replace (Str.regexp "section_start:[0-9]*:[a-z_]*\r") ""
|> Str.global_replace (Str.regexp "section_end:[0-9]*:[a-z_]*\r") ""
Expand Down

0 comments on commit 2957d1b

Please sign in to comment.