Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: perlcritic - Is it possible to "nest" perlcriticrc files?

by codiac (Beadle)
on Mar 18, 2016 at 14:30 UTC ( #1158235=note: print w/replies, xml ) Need Help??


in reply to perlcritic - Is it possible to "nest" perlcriticrc files?

Should be possible to do in a test file, untested for irony:
use Test::More; ues Perl::Critic; my $policy = Perl::Critic->import( -verbose => 8, -severity => 5, -profile => '/path/to/corporate/perlcriticrc', -exclude => [ ], -include => [ 'Subroutines:ProhibitUnusedPrivateSubroutines', ], ); $policy->add_policy( -policy => 'Modules:ProhibitExcessMainComplexity' +, -params => {max_mccabe => 10} ) foreach my $file (globidyglob some files) { my @dohs = $policy->critique($file); is(0, not scalar @dohs, "for shame!"); }
You could probably do it with Test::Perl::Critic, but I couldn't figure out how to get it to pass the max_mccabe param through off the top of my head and it's Friday beer O'clock time :)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1158235]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2023-09-26 05:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?