| 1 | package TAP::Formatter::GitHubActions::Utils; | ||||||||||
| 2 | |||||||||||
| 3 | 3 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 3 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 3 | ▶ | use v5.16; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 3 | our @EXPORT_OK = qw(log_annotation_line); | |||||||||
| 8 | |||||||||||
| 9 | 35 | ▶ | sub log_annotation_line { | ||||||||
|
Subroutine
log_annotation_line: called CC=2 SCAR=7.0
Pod
documented
| |||||||||||
| 10 | 35 | my (%args) = @_; | |||||||||
| 11 | |||||||||||
| 12 | 35 | my $body = $args{body}; | |||||||||
| 13 | 35 | my $title = $args{title}; | |||||||||
| 14 | |||||||||||
| 15 | # If title is given, write it, else just keep body | ||||||||||
| 16 | 35 | ▶ | my $line = $title ? ( | ||||||||
|
Branch: 1 branch
| |||||||||||
| 17 | "::%s file=%s,line=%s,title=${title}::%s" | ||||||||||
| 18 | ) : ( | ||||||||||
| 19 | "::%s file=%s,line=%s::%s" | ||||||||||
| 20 | ); | ||||||||||
| 21 | |||||||||||
| 22 | 35 | $body =~ s/\n/%0A/mg; | |||||||||
| 23 | |||||||||||
| 24 | return sprintf( | ||||||||||
| 25 | $line, | ||||||||||
| 26 | 35 | $args{type}, $args{filename}, $args{line}, $body | |||||||||
| 27 | ); | ||||||||||
| 28 | } | ||||||||||
| 29 | |||||||||||
| 30 | 3 | 1; | |||||||||
| 31 | __END__ | ||||||||||