Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

Re: Request for Comments on Perl::Critic

by hossman (Prior)
on Nov 01, 2005 at 08:09 UTC ( #504538=note: print w/replies, xml ) Need Help??

in reply to Request for Comments on Perl::Critic

I've only spent about 5 minutes looking at it, but so far it looks good.

Politics. Coding practices are always a sensitive area. Although I have used Conway's book as a reference, Perl::Critic is not limited to his rules and will even support contradicting rules. How can we design and represent Perl::Critic to serve the greater-good without alienating people or starting flame wars?

I think the key to not alienating people, is to provide an extremely large set of policies in the main distribution, but only enable a small subset of them by default -- a subset that nearly everyone on the planet can agree on, policies that identify truely risky patterns. This way, when people first try your tool, they don't feel "picked on" the first time they run it against their code base. Let them get comfortable with the system, and discover the plethora of policies they can choose to turn on, and gradually realize "hmmm ... yeah, that is a bad idea.

I haven't delved into your docs enough to know if this is already supported: but having a very easy way to turn on "all policies except the following list: ..." would be another good way to encourage people to use this tool without a lot of work

Examples of policies I think are good, but probably don't need to be on by default...

  1. ControlStructures::ProhibitCStyleForLoops
  2. CodeLayout::ProhibitParensWithBuiltins
  3. CodeLayout::RequireTidyCode
  4. ControlStructures::ProhibitCascadingIfElse

...these are all good ideas, but I don't know that I'd consider them dangerous -- let people turn them on manually once they clean up all their bigger problems.

PS: ValuesAndExpressions::ProhibitInterpolationOfLiterals seems to be overly critical. It doesn't seem to much of a stretch to use double-quotes to quote single quotes...

my $t = "can't please anybody";

Replies are listed 'Best First'.
Re^2: Request for Comments on Perl::Critic
by Roy Johnson (Monsignor) on Nov 01, 2005 at 22:47 UTC
    Having some thematic groupings of policies, e.g., "Minimal" (what you propose), "PBP" (for as many of those policies as it handles), etc., might be handy for people who don't want to wade through a universe of settings.

    Caution: Contents may have been coded under pressure.
Re^2: Request for Comments on Perl::Critic
by jthalhammer (Friar) on Nov 02, 2005 at 22:10 UTC
    You can select/deselect Policies that match an arbitrary regular expression using the -include and -exclude options with perlcritic. See the POD for more details.

    Based on your suggestions, I have some new ideas to make Perl::Critic a little kinder and gentler. Thanks for the great feedback!


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://504538]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (6)
As of 2018-05-26 11:16 GMT
Find Nodes?
    Voting Booth?