summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Rothenberg <rrwo@cpan.org>2020-03-30 11:54:46 +0100
committerRobert Rothenberg <rrwo@cpan.org>2020-03-30 11:54:46 +0100
commit5cfa72741cde3dd9688072f76fab288d542b45c9 (patch)
treefbdb1a923efefa1019216e5bfe9118562a498bf1
parent4d97d5d12f2072ea786b83cdbf9cd0d1bb86dd46 (diff)
Move Perl::Critic exceptions into perlcriticrc
-rw-r--r--Changes3
-rw-r--r--lib/Sys/CpuLoad.pm8
-rw-r--r--t/etc/perlcritic.rc2
3 files changed, 9 insertions, 4 deletions
diff --git a/Changes b/Changes
index 998e43c..9933ae9 100644
--- a/Changes
+++ b/Changes
@@ -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