Closed petdance closed 9 years ago
It is not possible to coerce policies into another theme, so the short answer is that all of the policies in this package are designed to be used with no setup like: perlcritic --theme freenode
.
From a brief inspection, the core policy appears to allow more special cases such as defined &sub
; it is probably more thorough. I may switch the freenode policy to subclass it instead.
Can you please explain more what you mean here:
It is not possible to coerce policies into another theme, so the short answer is that all
of the policies in this package are designed to be used with no setup like: perlcritic --theme freenode.
Are you saying that the policies here are meant to be used standalone, without the rest of the core policies, so that redundancy between the Freenode policies and the core policies don't matter?
I'm saying it's not possible to use the core policies in the "freenode" theme directly, just by installing Perl::Critic::Freenode. So yes it is designed to be used standalone. In a custom .perlcriticrc you can of course use the policies in any combination.
Here's the bummer on my end: I installed ::Freenode and turned them all on in my perlcriticrc that is used as part of a call to critic in a commit hook. Now, I get duplicated warnings for some, and warnings for things that already have ## no critic() annotations for the original warning.
It would help a lot if the policies that are duplicates would say "These are duplicates of core policies", or even if it's not intended to be used like I use it, to say "Don't use these as a whole, only one-by-one."
I will try to clarify these things in the docs. Thanks for the reports.
Clarified in commit b6bdee2
https://metacpan.org/pod/Perl::Critic::Policy::Freenode::AmpersandSubCalls does not say anything about how it is different from https://metacpan.org/pod/Perl::Critic::Policy::Subroutines::ProhibitAmpersandSigils.
Is it indeed different/better? Should users use the Freenode version instead of the core one? When should the user choose one over the other?
Or is it just redundant?