From 7e81b08a1d0e7efe4545a529c0bc031ef84fdf3c Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Sat, 31 Oct 2015 23:43:06 +0000 Subject: [PATCH] Make perlcritic happy --- lib/Gruntmaster/Daemon.pm | 2 +- lib/Gruntmaster/Daemon/Format.pm | 2 +- lib/Gruntmaster/Daemon/Judge/Points.pm | 2 +- t/perlcriticrc | 6 ++++++ 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/Gruntmaster/Daemon.pm b/lib/Gruntmaster/Daemon.pm index 03810ba..a726219 100644 --- a/lib/Gruntmaster/Daemon.pm +++ b/lib/Gruntmaster/Daemon.pm @@ -121,7 +121,7 @@ sub process_job { $meta->{timeout} = $timeout_override if defined $timeout_override; $meta->{tests} = decode_json $pb->{tests} if $meta->{runner} eq 'File'; $job->{contest} &&= contest_entry($job->{contest}); - delete $meta->{precnt} unless $job->{contest} && $job->{contest}{started} && !$job->{contest}{finished}; + delete $meta->{precnt} unless $job->{contest} && $job->{contest}{started} && !$job->{contest}{finished}; ## no critic (ProhibitNegativeExpressionsInUnlessAndUntilConditions) $meta->{testcnt} = $meta->{precnt} if $meta->{precnt}; $meta->{files}{ver} = { diff --git a/lib/Gruntmaster/Daemon/Format.pm b/lib/Gruntmaster/Daemon/Format.pm index 7b6f77b..d5560db 100644 --- a/lib/Gruntmaster/Daemon/Format.pm +++ b/lib/Gruntmaster/Daemon/Format.pm @@ -45,7 +45,7 @@ sub execlist_finish { my ($vm, $kill) = @_; if ($vm{$vm}) { - warn "Cannot kill VM" if $kill; + warn "Cannot kill VM\n" if $kill; $vm{$vm}->expect(5, '# '); } else { kill KILL => $pid{$vm} if $kill; diff --git a/lib/Gruntmaster/Daemon/Judge/Points.pm b/lib/Gruntmaster/Daemon/Judge/Points.pm index 66286b2..26c19f9 100644 --- a/lib/Gruntmaster/Daemon/Judge/Points.pm +++ b/lib/Gruntmaster/Daemon/Judge/Points.pm @@ -13,7 +13,7 @@ our $VERSION = '5999.000_004'; ################################################## sub judge{ - no warnings qw/numeric/; ## no critic (ProhibitNoWarnings) + no warnings qw/numeric/; get_logger->trace("Judging results: @_"); my $points = sum 0, grep { !ref } @_; $points == 100 ? (result => AC, result_text => 'Accepted') : (result => REJ, result_text => "$points points", points => $points) diff --git a/t/perlcriticrc b/t/perlcriticrc index 96564fe..40b151e 100644 --- a/t/perlcriticrc +++ b/t/perlcriticrc @@ -7,8 +7,11 @@ severity = 1 [-Documentation::PodSpelling] [-Documentation::RequirePodLinksIncludeText] [-InputOutput::RequireBracedFileHandleWithPrint] +[-Modules::ProhibitAutomaticExportation] [-References::ProhibitDoubleSigils] [-RegularExpressions::ProhibitEnumeratedClasses] +[-RegularExpressions::ProhibitUnusualDelimiters] +[-RegularExpressions::RequireBracesForMultiline] [-RegularExpressions::RequireLineBoundaryMatching] [-Subroutines::RequireFinalReturn] [-ValuesAndExpressions::ProhibitConstantPragma] @@ -33,3 +36,6 @@ script_sections = NAME | SYNOPSIS | DESCRIPTION | AUTHOR | COPYRIGHT AND LICENSE [Subroutines::RequireArgUnpacking] short_subroutine_statements = 5 allow_subscripts = 1 + +[TestingAndDebugging::ProhibitNoWarnings] +allow_with_category_restriction = 1 -- 2.39.2