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

How does Freenode::AmpersandSubCalls differ from core Subroutines::ProhibitAmpersandSigils? #11

Closed petdance closed 9 years ago

petdance commented 9 years ago

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?

Grinnz commented 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 ⊂ it is probably more thorough. I may switch the freenode policy to subclass it instead.

petdance commented 9 years ago

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?

Grinnz commented 9 years ago

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.

petdance commented 9 years ago

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."

Grinnz commented 9 years ago

I will try to clarify these things in the docs. Thanks for the reports.

Grinnz commented 9 years ago

Clarified in commit b6bdee2