diff options
author | Robert Rothenberg <rrwo@cpan.org> | 2020-03-30 11:54:46 +0100 |
---|---|---|
committer | Robert Rothenberg <rrwo@cpan.org> | 2020-03-30 11:54:46 +0100 |
commit | 5cfa72741cde3dd9688072f76fab288d542b45c9 (patch) | |
tree | fbdb1a923efefa1019216e5bfe9118562a498bf1 | |
parent | 4d97d5d12f2072ea786b83cdbf9cd0d1bb86dd46 (diff) |
Move Perl::Critic exceptions into perlcriticrc
-rw-r--r-- | Changes | 3 | ||||
-rw-r--r-- | lib/Sys/CpuLoad.pm | 8 | ||||
-rw-r--r-- | t/etc/perlcritic.rc | 2 |
3 files changed, 9 insertions, 4 deletions
@@ -6,6 +6,9 @@ Revision history for Perl extension {{$dist->name}}: - Add the ability to override the path of uptime. + [Other] + - Move Perl::Critic exceptions into t/etc/perlcriticrc. + 0.23 2020-03-29 13:09:50+01:00 Europe/London (TRIAL RELEASE) [Enhancements] - Support getloadavg for DragonFly BSD. diff --git a/lib/Sys/CpuLoad.pm b/lib/Sys/CpuLoad.pm index 2953d8d..4f0fac4 100644 --- a/lib/Sys/CpuLoad.pm +++ b/lib/Sys/CpuLoad.pm @@ -107,7 +107,7 @@ sub proc_loadavg { } } - return undef; ## no critic (ProhibitExplicitReturnUndef) + return undef; } our $UPTIME; @@ -117,15 +117,15 @@ sub uptime { $ENV{'LC_NUMERIC'} = 'POSIX'; # ensure that decimal separator is a dot $UPTIME ||= which("uptime") or - return undef; ## no critic (ProhibitExplicitReturnUndef) + return undef; run3($UPTIME, \undef, \my $line); - return undef if $? || !defined($line); ## no critic (ProhibitExplicitReturnUndef) + return undef if $? || !defined($line); if ( $line =~ /(\d+\.\d+)\s*,?\s+(\d+\.\d+)\s*,?\s+(\d+\.\d+)\s*$/m ) { return ( $1, $2, $3 ); } - return undef; ## no critic (ProhibitExplicitReturnUndef) + return undef; } sub BEGIN { diff --git a/t/etc/perlcritic.rc b/t/etc/perlcritic.rc new file mode 100644 index 0000000..2fc2c9e --- /dev/null +++ b/t/etc/perlcritic.rc @@ -0,0 +1,2 @@ +[Perl::Critic::Policy::Subroutines::ProhibitExplicitReturnUndef] +severity = 1 |