Grinnz / Perl-Critic-Community

Perl::Critic::Community - Community-inspired Perl::Critic policies
https://metacpan.org/pod/Perl::Critic::Community
Other
8 stars 10 forks source link

Whitelist for DiscouragedModules/PreferredAlternatives #42

Closed zackw closed 2 years ago

zackw commented 3 years ago

Sometimes you have no choice but to use a module on one of the discouraged lists. Right now, you have to turn the entire policy off to make perlcritic happy with that. It would be nice if it were possible to configure these policies with a list of specific modules to be allowed.

Example: I have a whole bunch of scripts that can only depend on core library modules, nothing from CPAN. They use FindBin; in the context it's used, it does the Right Thing. I'd like to be able to write something like

[Community::DiscouragedModules]
allow = FindBin