Exclude ProhibitLeadingZeros from perlcritic, use .perlcriticrc

This commit is contained in:
Joe Cooper
2026-05-19 20:40:29 -05:00
parent 308cb0c71d
commit 844b5f8174
7 changed files with 12 additions and 8 deletions

6
.perlcriticrc Normal file
View File

@@ -0,0 +1,6 @@
severity = 5
# Octal file permission literals (0700, 0640, etc.) are the standard Perl
# idiom for chmod/mkdir/permission helpers throughout this codebase. The
# policy flags chmod 0700 itself, so it is too coarse for our use.
[-ValuesAndExpressions::ProhibitLeadingZeros]

View File

@@ -37,7 +37,7 @@ my %link = ( 'id' => &generate_random_id(),
'user' => $wuser->{'name'},
'uuser' => $unixuser, );
$link{'id'} || &error($text{'forgot_erandom'});
&make_dir($main::forgot_password_link_dir, 0700); ## no critic (ProhibitLeadingZeros)
&make_dir($main::forgot_password_link_dir, 0700);
my $linkfile = $main::forgot_password_link_dir."/".$link{'id'};
&lock_file($linkfile);
&write_file($linkfile, \%link);

View File

@@ -73,7 +73,7 @@ else {
&save_module_acl(\%maccess, $in{'_acl_user'},
$in{'_acl_mod'},1);
}
&set_ownership_permissions(undef, undef, 0640, $aclfile); ## no critic (ProhibitLeadingZeros)
&set_ownership_permissions(undef, undef, 0640, $aclfile);
&unlock_file($aclfile);
if ($in{'_acl_group'}) {

View File

@@ -131,7 +131,7 @@ if ($in{'old'} && $in{'acl_security_form'}) {
my $aclfile = "$config_directory/$in{'name'}.gacl";
&lock_file($aclfile);
&save_group_module_acl(\%uaccess, $in{'name'}, "", 1);
&set_ownership_permissions(undef, undef, 0640, $aclfile); ## no critic (ProhibitLeadingZeros)
&set_ownership_permissions(undef, undef, 0640, $aclfile);
&unlock_file($aclfile);
}

View File

@@ -378,7 +378,7 @@ if ($in{'acl_security_form'} && !$newgroup && !$in{'safe'}) {
$uaccess{'rpc'} = $in{'rpc'};
&lock_file($aclfile);
&save_module_acl(\%uaccess, $in{'name'}, "", 1);
&set_ownership_permissions(undef, undef, 0640, $aclfile); ## no critic (ProhibitLeadingZeros)
&set_ownership_permissions(undef, undef, 0640, $aclfile);
&unlock_file($aclfile);
}

View File

@@ -51,8 +51,7 @@ if (!@files) {
}
my $critic = Perl::Critic->new(
-severity => 5,
-profile => '',
-profile => "$bindir/../../.perlcriticrc",
);
foreach my $file (@files) {

View File

@@ -46,8 +46,7 @@ if (!@files) {
}
my $critic = Perl::Critic->new(
-severity => 5,
-profile => '',
-profile => "$bindir/../../.perlcriticrc",
);
foreach my $file (@files) {