Re: Perl::Critic / Perl static analysis?
On 29 March 2011 07:04, David Golden <firstname.lastname@example.org> wrote:
> On Mon, Mar 28, 2011 at 10:41 PM, Russ Allbery <email@example.com> wrote:
>> Paul Wise <firstname.lastname@example.org> writes:
>>> David Golden <email@example.com> wrote:
>>>> You'll probably irritate upstream authors if you do that. The default
>>>> Perl::Critic rules are very specific to Perl Best Practices (the book),
>>>> which the author states are just *one* set of possible best practices.
>>> Sadly the "Perl Best Practices" online viewer isn't supported by Gnash
>>> so the warnings it outputs are also of limited use.
>> Yeah, I ran it once on some of my code, agreed with about half of it,
>> disagreed completely with about a quarter of it, and couldn't figure out
>> what another quarter of it was talking about since I needed to go read a
>> book that I don't own. Sounds like there's now a way to read the book
>> without buying it (?), but still, eh.
> I believe you can crank up the verbosity of the output to include a
> summary of the issues (so you don't need the book). There are also
> many plugins that provide style rules that have nothing to do with the
> book. It's really a great tool for authors to help improve
> consistency, particularly in a team or group development setting.
You can indeed crank up the verbosity so that it prints about a page
of text for each "condition" it detects. I use it for my code
regularly, and generally agree with most of the high severity tests.
The lower ones become much more a question of style and personal
taste, so you may not want to use the lower severity tests.
pgp: [74B1FA37] (http://www.strangeparty.com/anton.asc)
fingerprint: 7401 96D3 E037 2F8F 5965 A358 4046 71FD 74B1 FA37
No trees were destroyed in the sending of this message, however, a
significant number of electrons were terribly inconvenienced.