[SCM] Debian package checker branch, master, updated. 2.5.12-10-g78c8a89
The following commit has been merged in the master branch:
commit 78c8a89099120501faef94ac9fbe346b5d9ab5b5
Author: Niels Thykier <niels@thykier.net>
Date: Sat Apr 20 13:03:21 2013 +0200
Apply PerlCritic to reporting as well
Signed-off-by: Niels Thykier <niels@thykier.net>
diff --git a/reporting/harness b/reporting/harness
index d9c229b..d7a1720 100755
--- a/reporting/harness
+++ b/reporting/harness
@@ -21,6 +21,8 @@
# MA 02110-1301, USA.
use strict;
+use warnings;
+
use Getopt::Long;
@@ -88,7 +90,7 @@ die "Cannot use other modes with reports only.\n"
if $opt{'reports-only'} && ($opt{'full-mode'} || $opt{'incremental-mode'});
# read configuration
-require './config';
+require './config'; ## no critic (Modules::RequireBarewordIncludes)
use vars qw($LINTIAN_ROOT $LINTIAN_LAB $LINTIAN_ARCHIVEDIR $LINTIAN_DIST
$LINTIAN_ARCH $LINTIAN_CFG
$lintian_cmd $html_reports_cmd
@@ -118,7 +120,7 @@ require Lintian::Util;
import Lintian::Util qw(strip visit_dpkg_paragraph);
# turn file buffering off
-$| = 1;
+STDOUT->autoflush;
unless ($opt{'dry-run'}) {
# rotate log files
@@ -202,7 +204,7 @@ unless ($opt{'reports-only'}) {
# Use the FullEWI output as it is less ambiguous for html_reports - it shouldn't make a difference
# but still...
my $cmd ="$lintian_cmd -I -E --pedantic -v --show-overrides -U changelog-file".
- " --exp-output=format=fullewi --packages-from-file -";
+ ' --exp-output=format=fullewi --packages-from-file -';
# Remove old/stale packages from the lab
foreach my $diff (@diffs) {
my $type = $diff->type;
@@ -372,7 +374,6 @@ unless ($opt{'reports-only'}) {
if (@worklist) {
# incremental run cmd changes
- $cmd .= " --packages-from-file -";
my $lintpipe;
my $scs = $opt{'schedule-chuck-size'};
my $round = 0;
@@ -387,7 +388,7 @@ unless ($opt{'reports-only'}) {
}
Log (sprintf ('Groups to process %d will take %d round(s) [round limit: %s]',
- scalar @worklist, $rounds, $scs > 0 ? $scs : "none"));
+ scalar @worklist, $rounds, $scs > 0 ? $scs : 'none'));
while (@worklist) {
my $start = 0;
@@ -428,7 +429,7 @@ unless ($opt{'reports-only'}) {
# If someone is sending us signals (e.g. SIGINT/Ctrl-C)
# don't start the next round.
# - 35k / 512 => 700 rounds (or 700 SIGINTs to stop...)
- Log (" - skipping the rest of the worklist");
+ Log(' - skipping the rest of the worklist');
@worklist = ();
}
}
diff --git a/reporting/html_reports b/reporting/html_reports
index 09642f4..ca6e8e5 100755
--- a/reporting/html_reports
+++ b/reporting/html_reports
@@ -22,6 +22,7 @@
# MA 02110-1301, USA.
use strict;
+use warnings;
use POSIX qw(strftime);
use File::Copy qw(copy);
@@ -40,7 +41,7 @@ our ($LINTIAN_ROOT, $LINTIAN_LAB, $LINTIAN_ARCHIVEDIR, $LINTIAN_DIST,
$GRAPHS_RANGE_DAYS, $GRAPHS, $LINTIAN_MIRROR_NAME);
# Read the configuration.
-BEGIN { require './config'; }
+BEGIN { require './config'; } ## no critic (Modules::RequireBarewordIncludes)
# The path to the mirror timestamp.
our $LINTIAN_TIMESTAMP
@@ -623,8 +624,8 @@ if ($GRAPHS) {
mkdir("$graph_dir/tags", 0777)
or die "cannot create output directory $graph_dir/tags: $!\n";
- my $date_min = strftime ("%s", localtime ($unix_time - 3600 * 24 * $GRAPHS_RANGE_DAYS));
- my $date_max = strftime ("%s", localtime ($unix_time));
+ my $date_min = strftime ('%s', localtime ($unix_time - 3600 * 24 * $GRAPHS_RANGE_DAYS));
+ my $date_max = strftime ('%s', localtime ($unix_time));
# Generate loadable Gnuplot file with common variables and labels/arrows
# for Lintian versions.
@@ -705,6 +706,11 @@ sub maintainer_url {
# with a given e-mail address, issues a warning if two maintainers have the
# same e-mail address, and returns the maintainer string that we should use
# (which is whatever maintainer we saw first with that e-mail).
+
+# PerlCritic apparently does not recognise this way of "encapsulating"
+# variables. Though, these could probably be replaced by "state"
+# variables.
+## no critic (ControlStructures::ProhibitUnreachableCode)
{
my (%urlmap, %warned);
sub map_maintainer {
diff --git a/t/scripts/critic.t b/t/scripts/critic.t
index eee65d7..f20c090 100755
--- a/t/scripts/critic.t
+++ b/t/scripts/critic.t
@@ -35,7 +35,7 @@ for my $check (@CHECKS) {
critic_ok('t/runtests');
subtest 'All scripts with correct shebang or extension' => sub {
- all_critic_ok(qw(collection frontend lib private t/scripts t/helper));
+ all_critic_ok(qw(collection frontend lib private reporting t/scripts t/helper));
};
sub should_skip() {
--
Debian package checker
Reply to: