File Coverage

File:generate-apply.pl
Coverage:96.9%

linestmtbrancondsubtimecode
1#!/usr/bin/env perl
2
1
1
1
1465
6838
549
use JSON::PP;
3sub read_null_delimited_file {
4
2
3
  my ($file) = @_;
5
2
4
  local $/=undef;
6
1
1
1
2
241
7
1
23
  return () unless open my $input, '<:encoding(UTF-8)', $file;
7
2
381
  my @files = split /\0/, <$input>;
8
2
19
  close $input;
9
2
5
  return @files;
10}
11
1
38778
my @expect_files = read_null_delimited_file $ENV{expect_files};
12
1
2
my @excludes_files = read_null_delimited_file $ENV{excludes_files};
13
1
17
my $new_expect_file = $ENV{new_expect_file};
14
1
1
my $excludes_file = $ENV{excludes_file};
15
1
1
my $spelling_config = $ENV{spelling_config};
16
1
0
my $job = $ENV{THIS_GITHUB_JOB_ID};
17
1
1
$config{"excludes_file"} = $excludes_file;
18
1
1
$config{"new_expect_file"} = $new_expect_file;
19
1
1
$config{"spelling_config"} = $spelling_config;
20
1
1
$config{"expect_files"} = \@expect_files;
21
1
1
$config{"excludes_files"} = \@excludes_files;
22
1
1
$config{"job"} = $job;
23
1
1
$config{"only_check_changed_files"} = $ENV{INPUT_ONLY_CHECK_CHANGED_FILES};
24
1
2
my $json_canonical = JSON::PP->new->canonical([1]);
25
1
21
print $json_canonical->utf8->encode(\%config);