Skip to content

Commit

Permalink
Recognize locale_h import and a char alternation
Browse files Browse the repository at this point in the history
To comply with the perlcritic TooMuchCode::ProhibitUnusedImport and
RegularExpressions::ProhibitSingleCharAlternation policies.
  • Loading branch information
Julien-Elie committed Sep 8, 2024
1 parent 66933b5 commit e0a10ea
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion control/perl-nocem.in
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use strict;
use warnings;

use Getopt::Std;
use POSIX qw(locale_h strftime);
use POSIX qw(locale_h strftime); ## no critic (ProhibitUnusedImport)
use Sys::Hostname;

sub logmsg($;$);
Expand Down
18 changes: 10 additions & 8 deletions scripts/innreport.in
Original file line number Diff line number Diff line change
Expand Up @@ -3084,15 +3084,17 @@ sub PrepareEval($;$) {
# However, a few variables are defined through the enclosure.
# $a and $b are provided by function sort.
# So convert "%innreport_inn::prog_type" back to "%prog_type"
## no critic (ProhibitSingleCharAlternation)
$string =~ s/([\$\%\@])${CLASS}\:\:(
a|
b|
key\d*|
num|
prog_size|
prog_type|
sec_glob
)\b/$1$2/xog;
a|
b|
key\d*|
num|
prog_size|
prog_type|
sec_glob
)\b/$1$2/xog;
## use critic

# If expression consists of a single hash then just return a
# reference to it.
Expand Down
2 changes: 1 addition & 1 deletion storage/ovsqlite/ovsqlite-util.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use warnings;

use Compress::Zlib;
use Getopt::Std;
use POSIX qw(strftime locale_h);
use POSIX qw(strftime locale_h); ## no critic (ProhibitUnusedImport)

$0 =~ s!.*/!!;

Expand Down

0 comments on commit e0a10ea

Please sign in to comment.