Skip to content

Commit

Permalink
look for error code usage in data providers
Browse files Browse the repository at this point in the history
  • Loading branch information
gbicann committed Jul 17, 2024
1 parent b8357ab commit 134915d
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion tools/lint.pl
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,24 @@ sub check_error {
}
}

PROVIDER: foreach my $provider ($spec->providers) {
my $i = 0;
COLUMN: foreach my $column ($provider->columns) {
if ('errorCode' eq $column->name) {
ROW: foreach my $row (@{$provider->rows}) {
if ($error->id eq $row->[$i]) {
$used = 1;
last PROVIDER;
}
}
}
$i++;
}
}

warn(sprintf("Error '%s' appears to have a placeholder description", $error->id)) if ($error->{'Description'} =~ /^TBA/);

warn(sprintf("Error '%s' is not used by any cases", $error->id)) unless ($used);
warn(sprintf("Error '%s' is not used by any cases or data providers", $error->id)) unless ($used);
}

sub check_provider {
Expand Down

0 comments on commit 134915d

Please sign in to comment.