YAPC::NA 2006 — Chris Dolan

How Perl::Critic Facilitates Code Best Practices

License
Creative Commons Attribution + Share Alike 2.5
When
2006-06-26 4:22 PM CST
Duration
28 Minutes, 44 Seconds

Damian Conway's book "Perl Best Practices" has sparked a revolution in coding style among CPAN developers. Even before that book, many of those developers have wanted a way to judge whether their code conforms with a selection of best practices, hence modules like Perl::Tidy, B::Lint and even "use strict". Perl::Critic is a new module which strives to be a powerful and flexible tool to judge code against a user-selected array of "Policy" modules. Example policies include "CodeLayout::ProhibitHardTabs" and "TestingAndDebugging::RequireUseStrict". As of v0.15, we have implemented 70 policies, most of which derive from the 256 recommendations made by Conway. The API uses Module::Pluggable to enable third-parties to easily add more policies. A separate Test::Perl::Critic module makes it easy to confirm that your code is still in compliance with your established policies.

In this presentation, I will present Perl::Critic's features and demonstrate how you can start using it against your own code.

Media

More YAPC::NA 2006 presentations