Skip Menu |

This queue is for tickets about the Module-CPANTS-Analyse CPAN distribution.

Report information
The Basics
Id: 24228
Status: resolved
Priority: 0/
Queue: Module-CPANTS-Analyse

Owner: domm [...]
Requestors: thaljef [...]

Bug Information
Severity: Important
Broken in: (no value)
Fixed in: (no value)

Subject: Build fails due to Perl::Critic violations
Download (untitled) / with headers
text/plain 1.5k
Hi there- I was installing Module-CPANTS-Analyse, (by way of the cpan shell) and the 99_critic.t script emitted several failures due to violation of various Perl::Critic policies. I'm sure it passes the 99_critic.t tests on your machine because you have customized your .perlcriticrc file to fit your personal coding standards. But your .perlcriticrc file is not the same as mine. In general, I think CPAN distributions should not be shipped with a Test::Perl::Critic script, or else it should be disabled by default. For example, the Perl-Critic distro contains a criticize.t script, but it skips all the tests unless the AUTHOR_TEST environment variable is set to a true value. (See Critic-0.21/t/40_criticize.t) In addition, you can ship your distribution with a copy of your custom perlcriticrc file, and then point Test::Perl::Critic at it: use File::Spec; eval { require Test::Perl::Critic }; plan skip_all => 'Test::Perl::Critic needed to critique' if $@; my $rcfile = File::Spec->catfile( 't', 'perlcriticrc' ); Test::Perl::Critic->import( -profile => $rcfile ); all_critic_ok(); That way, the distro is critiqued using the settings that you intended. However, this still might cause unexpected failures because the end-user may have additional Perl::Critic policies installed on their local machine. So again, it is best to have the Test::Perl::Critic test disabled by default. I apologize for not making this a little clearer in the Test::Perl::Critic documentation. I'll try and improve it in the next release. -Jeff
Thanks for the suggestion, I've added a $ENV{AUTHOR_TEST} check to t/99_critic.t

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to