Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^3: Module Announcement: Perl-Critic-1.01

by BrowserUk (Pope)
on Jan 26, 2007 at 23:43 UTC ( #596803=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Module Announcement: Perl-Critic-1.01
in thread Module Announcement: Perl-Critic-1.01

I just tried again, and got

perltidy had errors!! at line 1, column 1. See page 33 of PBP. RCS key +words $Id$ not found at line 1, column 1. See page 441 of PBP. RCS ke +ywords $Revision$, $HeadURL$, $Date$ not found at line 1, column 1. S +ee page 441 of PBP. RCS keywords $Revision$, $Source$, $Date$ not fou +nd at line 1, column 1. See page 441 of PBP. Code not contained in ex +plicit package at line 1, column 1. Violates encapsulation. No "VERSI +ON" variable found at line 1, column 1. See page 404 of PBP. Code bef +ore strictures are enabled at line 1, column 1. See page 429 of PBP. +Code before warnings are enabled at line 1, column 1. See page 431 of + PBP. Code not contained in explicit package at line 2, column 33. Vi +olates encapsulation. Useless interpolation of literal string at line + 2, column 38. See page 51 of PBP. Code not contained in explicit pac +kage at line 2, column 51. Violates encapsulation. Useless interpolat +ion of literal string at line 2, column 60. See page 51 of PBP. Code +not contained in explicit package at line 7, column 1. Violates encap +sulation. Code not contained in explicit package at line 9, column 1. + Violates encapsulation. Mixed-case subroutine name at line 9, column + 1. See page 44 of PBP. Code not contained in explicit package at lin +e 10, column 5. Violates encapsulation. Code not contained in explici +t package at line 11, column 5. Violates encapsulation. "die" used in +stead of "croak" at line 11, column 52. See page 283 of PBP. Magic pu +nctuation variable used at line 11, column 56. See page 79 of PBP. Co +de not contained in explicit package at line 12, column 5. Violates e +ncapsulation. Quotes used with an empty string at line 12, column 24. + See page 53 of PBP. Code not contained in explicit package at line 1 +2, column 33. Violates encapsulation. Magic punctuation variable used + at line 12, column 39. See page 79 of PBP. Code not contained in exp +licit package at line 12, column 47. Violates encapsulation. Code not + contained in explicit package at line 12, column 58. Violates encaps +ulation. Code not contained in explicit package at line 13, column 5. + Violates encapsulation. Code not contained in explicit package at li +ne 14, column 5. Violates encapsulation. Code not contained in explic +it package at line 17, column 1. Violates encapsulation. Code not con +tained in explicit package at line 17, column 8. Violates encapsulati +on. Code not contained in explicit package at line 18, column 1. Viol +ates encapsulation. Code not contained in explicit package at line 20 +, column 1. Violates encapsulation. Code not contained in explicit pa +ckage at line 20, column 25. Violates encapsulation. Code not contain +ed in explicit package at line 20, column 32. Violates encapsulation. + Code not contained in explicit package at line 21, column 1. Violate +s encapsulation. Code not contained in explicit package at line 21, c +olumn 11. Violates encapsulation. Code not contained in explicit pack +age at line 21, column 18. Violates encapsulation. Code not contained + in explicit package at line 23, column 2. Violates encapsulation. Co +de not contained in explicit package at line 23, column 3. Violates e +ncapsulation. Variable declared as "local" at line 23, column 3. See +pages 77,78,79 of PBP. "local" variable not initialized at line 23, c +olumn 3. See page 78 of PBP. Magic punctuation variable used at line +23, column 9. See page 79 of PBP. Code not contained in explicit pack +age at line 23, column 13. Violates encapsulation. Code not contained + in explicit package at line 25, column 1. Violates encapsulation. Mo +dule does not end with "1;" at line 25, column 21. Must end with a re +cognizable true value. Code not contained in explicit package at line + 25, column 21. Violates encapsulation. Code not contained in explici +t package at line 27, column 1. Violates encapsulation.

I still cannot make sense of this. Picking just one set of errors:

Code not contained in explicit package at line 12, column 5. Violates +encapsulation. Quotes used with an empty string at line 12, column 24. See page 53 of + PBP. Code not contained in explicit package at line 12, column 33. Violates + encapsulation. Magic punctuation variable used at line 12, column 39. See page 79 of +PBP. Code not contained in explicit package at line 12, column 47. Violates + encapsulation. Code not contained in explicit package at line 12, column 58. Violates + encapsulation.

Line 12 is blank!

I knew I wouldn't like it, but I at least expected to have to justify my arguments. But this?

This is just another example of the PC madness, like http://news.bbc.co.uk/1/hi/england/north_yorkshire/6296637.stm and many, many other examples that is gripping our world and turning it into a mirthless, freedomless place of bland, grey uniformity.

Thanks theDamian. You've gone from being the wild child of Perl, envied and awed by the many; to being the pillar of salt that the PHBs will forever use to enforce mediocrity, uniformity and the lowest common denominator upon the once hip and innovative and freedom loving world of Perl. Like the reformed smoker, or the born again religious, when you converted, you made sure that the PHBs will enforce your will upon the rest of us too.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.


Comment on Re^3: Module Announcement: Perl-Critic-1.01
Select or Download Code
Re^4: Module Announcement: Perl-Critic-1.01
by shmem (Canon) on Jan 27, 2007 at 01:46 UTC
    Dead on the mark, BrowserUk, and the link you provided is very appropriate:
    "I must admit the lady wasn't too persistent and I realised she was only doing what she's been told to do."

    A Morrisons spokesman said: "This is done with the best of intentions and we would hope it is taken in good humour by those obviously over the age of 21, as we do not wish to cause offence and no disrespect is intended.

    "We take our responsibility with regard to selling alcohol very seriously and all our stores operate the Task 21 scheme, which addresses the difficulties staff face in being able to determine if a customer is legally old enough to buy alcohol.

    "To further limit any element of doubt, staff at the Acomb store are required to ask anyone buying alcohol to confirm that they are over 21."

    Continue to force people to do things contrary to their understanding of what is best in a given context, only because there are rules that say so, and you end up with them not being able to trust their inner guidance any more.

    Perl is so much about context and expression, which comes along with ambiguities, that rule enforcing ultimately leads you to fighting your tool.

    If by some odd chance I have to live under the sway of Perl::Critic (or PBP, for that matter), I'll continue to say mkdir $dir, 0755 and not convert the flags to decimal, and I'll say opendir (D, $dir) or die "foo: $!\n" despite grouping parens for builtins being deprecated, because that way I can work best, fast, and I can read my code. Any other perler also can; the aforementioned expressions will only seem wrong to those which know PBP and don't know TIMTOWDI.

    I'll continue to use perl "to get your job done, before your boss fires you" (which you sometimes is me, sometimes is you). I guess I will have gob enough to argue with any PHB, and the code fixing a la Damian will be paid for, as well...

    --shmem

    _($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                                  /\_¯/(q    /
    ----------------------------  \__(m.====·.(_("always off the crowd"))."·
    ");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}

      FYI, a starting point for an appropriate ~/.perlcriticrc for you (based on the above) might look like:

      [-CodeLayout::ProhibitParensWithBuiltins] [-ValuesAndExpressions::ProhibitLeadingZeros] [-InputOutput::ProhibitTwoArgOpen] #if applicable to opendir

      I wouldn't disparage the tool because it recommends things you don't agree with. I think even TheDamian suggests that not everyone will agree with every "Best Practice", as any thread concerning PBP here will clearly show. However, enough can not be said for something that helps a team of developers write all code in a consistent manner, a manner that tends toward readability, maintainability, and as few bugs due to misunderstandings as possible.

      For posterity, my ~/.perlcriticrc file looks like this:

      [-RegularExpressions::RequireExtendedFormatting] [-RegularExpressions::RequireLineBoundaryMatching] [-Miscellanea::RequireRcsKeywords] [-Modules::RequireVersionVar] [ControlStructures::ProhibitPostfixControls] allow = if severity = 1

      Keep in mind that Perl::Critic is highly configurable, and will only alert you to "issues" at its current reporting level - which is quite low (when using the command line tool without any options).



      --chargrill
      s**lil*; $*=join'',sort split q**; s;.*;grr; &&s+(.(.)).+$2$1+; $; = qq-$_-;s,.*,ahc,;$,.=chop for split q,,,reverse;print for($,,$;,$*,$/)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://596803]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (17)
As of 2014-07-24 20:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (167 votes), past polls