treewide: update split calls to make perlcritic happy
In nixpkgs this started to fail the hydra tests. It's not completely clear why because it seems the perlcritic rule has existed for quite some time. Anyway, this should solve the issues.
This commit is contained in:
@@ -106,11 +106,11 @@ sub doEmailLogin {
|
||||
my $allowed_domains = $c->config->{allowed_domains} // ($c->config->{persona_allowed_domains} // "");
|
||||
if ($allowed_domains ne "") {
|
||||
my $email_ok = 0;
|
||||
my @domains = split ',', $allowed_domains;
|
||||
my @domains = split /,/, $allowed_domains;
|
||||
map { $_ =~ s/^\s*(.*?)\s*$/$1/ } @domains;
|
||||
|
||||
foreach my $domain (@domains) {
|
||||
$email_ok = $email_ok || ((split '@', $email)[1] eq $domain);
|
||||
$email_ok = $email_ok || ((split /@/, $email)[1] eq $domain);
|
||||
}
|
||||
error($c, "Your email address does not belong to a domain that is allowed to log in.\n")
|
||||
unless $email_ok;
|
||||
|
||||
@@ -71,7 +71,7 @@ sub buildFinished {
|
||||
|
||||
my $to = $build->jobset->emailoverride ne "" ? $build->jobset->emailoverride : $build->maintainers;
|
||||
|
||||
foreach my $address (split ",", ($to // "")) {
|
||||
foreach my $address (split /,/, ($to // "")) {
|
||||
$address = trim $address;
|
||||
|
||||
$addresses{$address} //= { builds => [] };
|
||||
|
||||
@@ -38,7 +38,7 @@ sub _parseValue {
|
||||
$start_options = 2;
|
||||
}
|
||||
foreach my $option (@parts[$start_options .. $#parts]) {
|
||||
(my $key, my $value) = split('=', $option);
|
||||
(my $key, my $value) = split(/=/, $option);
|
||||
$options->{$key} = $value;
|
||||
}
|
||||
return ($uri, $branch, $deepClone, $options);
|
||||
@@ -265,7 +265,7 @@ sub getCommits {
|
||||
|
||||
my $res = [];
|
||||
foreach my $line (split /\n/, $out) {
|
||||
my ($revision, $author, $email, $date) = split "\t", $line;
|
||||
my ($revision, $author, $email, $date) = split /\t/, $line;
|
||||
push @$res, { revision => $revision, author => decode("utf-8", $author), email => $email };
|
||||
}
|
||||
|
||||
|
||||
@@ -31,10 +31,10 @@ sub _iterate {
|
||||
$pulls->{$pull->{number}} = $pull;
|
||||
}
|
||||
# TODO Make Link header parsing more robust!!!
|
||||
my @links = split ',', ($res->header("Link") // "");
|
||||
my @links = split /,/, ($res->header("Link") // "");
|
||||
my $next = "";
|
||||
foreach my $link (@links) {
|
||||
my ($url, $rel) = split ";", $link;
|
||||
my ($url, $rel) = split /;/, $link;
|
||||
if (trim($rel) eq 'rel="next"') {
|
||||
$next = substr trim($url), 1, -1;
|
||||
last;
|
||||
|
||||
@@ -83,10 +83,10 @@ sub _iterate {
|
||||
$refs->{$ref_name} = $ref;
|
||||
}
|
||||
# TODO Make Link header parsing more robust!!!
|
||||
my @links = split ',', $res->header("Link");
|
||||
my @links = split /,/, $res->header("Link");
|
||||
my $next = "";
|
||||
foreach my $link (@links) {
|
||||
my ($url, $rel) = split ";", $link;
|
||||
my ($url, $rel) = split /;/, $link;
|
||||
if (trim($rel) eq 'rel="next"') {
|
||||
$next = substr trim($url), 1, -1;
|
||||
last;
|
||||
|
||||
@@ -49,10 +49,10 @@ sub _iterate {
|
||||
$pulls->{$pull->{iid}} = $pull;
|
||||
}
|
||||
# TODO Make Link header parsing more robust!!!
|
||||
my @links = split ',', $res->header("Link");
|
||||
my @links = split /,/, $res->header("Link");
|
||||
my $next = "";
|
||||
foreach my $link (@links) {
|
||||
my ($url, $rel) = split ";", $link;
|
||||
my ($url, $rel) = split /;/, $link;
|
||||
if (trim($rel) eq 'rel="next"') {
|
||||
$next = substr trim($url), 1, -1;
|
||||
last;
|
||||
|
||||
@@ -126,7 +126,7 @@ sub getCommits {
|
||||
my $res = [];
|
||||
foreach my $line (split /\n/, $out) {
|
||||
if ($line ne "") {
|
||||
my ($revision, $author, $email) = split "\t", $line;
|
||||
my ($revision, $author, $email) = split /\t/, $line;
|
||||
push @$res, { revision => $revision, author => $author, email => $email };
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ sub isBuildEligibleForDynamicRunCommand {
|
||||
sub configSectionMatches {
|
||||
my ($name, $project, $jobset, $job) = @_;
|
||||
|
||||
my @elems = split ':', $name;
|
||||
my @elems = split /:/, $name;
|
||||
|
||||
die "invalid section name '$name'\n" if scalar(@elems) > 3;
|
||||
|
||||
|
||||
@@ -109,7 +109,7 @@ subtest "Build: not substitutable, unsubstitutable" => sub {
|
||||
subtest "Second notification: step_finished" => sub {
|
||||
my ($channelName, $pid, $payload) = @{$dbh->func("pg_notifies")};
|
||||
is($channelName, "step_finished", "The event is for the step finishing");
|
||||
my ($buildId, $stepNr, $logFile) = split "\t", $payload;
|
||||
my ($buildId, $stepNr, $logFile) = split /\t/, $payload;
|
||||
is($buildId, $build->id, "The payload is the build's ID");
|
||||
is($stepNr, 1, "The payload is the build's step number");
|
||||
isnt($logFile, undef, "The log file is passed");
|
||||
|
||||
Reference in New Issue
Block a user