GitHubActions/Utils.pm

filter: Statementstmt 100% 16 / 16 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod 100% 1 / 1 totaltotal 95.6% 22 / 23 CC 2 SCAR 3.4
CC
2
Cov
94%
log_annotation_line
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.4
« GitHubActions/ErrorGroup.pm ↑ Summary GitHubActions/Error.pm »
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
BranchTrueFalseTotal
$title ? : 35 0 35
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__
« GitHubActions/ErrorGroup.pm ↑ Summary GitHubActions/Error.pm »