chore: perlcritic/perltidy passes

This commit is contained in:
Stéphane Lesimple 2020-12-16 12:53:47 +00:00
parent ea6867a614
commit 163a3fd726
No known key found for this signature in database
GPG key ID: 4B4A3289E9D35658
2 changed files with 21 additions and 19 deletions

View file

@ -31,6 +31,7 @@ sub dumpdoc {
die "something is missing: " . ($h{param} ? "" : "param ") . ($h{default} ? "" : "default ") . ($h{desc} ? "" : "desc ") . ($h{type} ? "" : "type") . "\n";
}
%h = ();
return;
}
my $state = '';
@ -78,7 +79,7 @@ while (<>) {
}
dumpdoc();
print <<EOF
print <<'EOF'
======================
bastion.conf reference
======================
@ -105,7 +106,7 @@ foreach my $section (@orderedsections) {
print "- :ref:`bastion_conf_$_`\n";
}
}
print <<EOF
print <<'EOF'
Option Reference
================
@ -113,5 +114,4 @@ Option Reference
EOF
;
print join("", @out);

View file

@ -250,7 +250,7 @@ sub load_configuration {
}
# if set to "no", "false" or "disabled", be nice and cast to false (because a string is true, otherwise)
elsif (grep { lc($C->{$o}) eq lc($_) } qw{ no false disabled }) {
elsif (grep { lc($C->{$o}) eq lc } qw{ no false disabled }) {
push @errors, "Configuration error: found value '" . $C->{$o} . "' for option '$o', but it's supposed to be a boolean, assuming false";
$C->{$o} = 0;
}
@ -294,7 +294,9 @@ sub load_configuration {
# 5/6) Arrays whose values should match a specific regex.
foreach my $o (
## no critic(RegularExpressions::ProhibitFixedStringMatches)
{name => 'allowedIngressSshAlgorithms', default => [qw{ rsa ecdsa ed25519 }], validre => qr/^(rsa|ecdsa|ed25519)$/},
## no critic(RegularExpressions::ProhibitFixedStringMatches)
{name => 'allowedEgressSshAlgorithms', default => [qw{ rsa ecdsa ed25519 }], validre => qr/^(rsa|ecdsa|ed25519)$/},
{name => 'accountCreateSupplementaryGroups', default => [], validre => qr/^(.*)$/},
{name => 'accountCreateDefaultPersonalAccesses', default => [], validre => qr/^(.*)$/},