nysus has asked for the wisdom of the Perl Monks concerning the following question:
I'm using Import::Base to generate boilerplate for my tests:
package Test::Utils; use parent 'Import::Base'; our @IMPORT_MODULES = ( 'strict', 'warnings', feature => [qw(:5.14)], 'Data::Dumper' => [qw(Dumper)], 'Test::More', 'Test::Exception', 'Test::Output', 'Test::Dirs', 'Test::Utils::Dump' => [qw(d d0 d1 $doff)], 'Term::ANSIColor', );
At the top of my test file, I have use Test::Utils and so strict is in effect. However, since perlcritic doesn't compile all the code, it's throwing warnings at me about not using strict. I tried to quiet the warnings in a .perlcriticrc file in my t directory:
severity = 5 [-TestingAndDebugging::RequireUseStrict]
But in nvim, I'm still seeing "S>" in a red background and when I put my cursor on the first line of code, the status line is showing this warning: "(5) Code before strictures are enabled (See page 429 of PBP)". Anything else I can do to suppress this warning?
UPDATE: I thought I found a solution using equivalent_modules=Test::Utils but it had no effect.
$PM = "Perl Monk's";
$MC = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate Priest Vicar Parson";
$nysus = $PM . ' ' . $MC;
Click here if you love Perl Monks
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Can't figure out how to quiet perlcritic and ignore RequireUseStrict perlcritic rule
by hippo (Archbishop) on Jan 15, 2024 at 16:30 UTC | |
by nysus (Parson) on Jan 15, 2024 at 17:07 UTC | |
by nysus (Parson) on Jan 15, 2024 at 17:59 UTC | |
|
Re: Can't figure out how to quiet perlcritic and ignore RequireUseStrict perlcritic rule
by nysus (Parson) on Jan 15, 2024 at 18:06 UTC |