Subject: | Adding new policy |
Date: | Fri, 18 May 2012 14:30:11 +0200 |
To: | <bug-Test-Perl-Critic-Progressive [...] rt.cpan.org> |
From: | Henrik Hald Nørgaard <hhn [...] jobindex.dk> |
When I add a new policy to my perlcritic configuration, the number of
violations of the new policy is not written to the history file used by
Test::Perl::Critic::Progressive.
Here is a patch that should fix this :
162a163
Show quoted text
> my $new_policies = 0;
174c175,178
< next if not defined $last_policy_violations;
---
Show quoted text> if (not defined $last_policy_violations) {
> $new_policies = 1;
> next;
> }
212c216
< if ( !$has_run_before || ($ok && $last_total_violations > 0) ) {
---
Show quoted text> if ( !$has_run_before || ($ok && $last_total_violations > 0) ||
$new_policies ) {
Kind regards
Henrik Hald Nørgaard, Programmør
Jobindex A/S, Holger Danskes Vej 91, 2000 Frederiksberg
Tlf.: +45 38 32 33 55, dir.: +45 38 32 33 81
<http://www.jobindex.dk/> www.jobindex.dk