четверг, 3 декабря 2009 г.

Using Perl::Critic in Subversion hook-script


A few weeks ago I wrote subversion hook-script that checks Perl code using Perl::Critic module. The script is called perlcritic-checker.pl If the code has violations then the entire commit will be rejected. The appropriate error message (colored and sorted by severity level) will be sent back to the client. This way you can employ consistent coding rules in your team.

The script can be configured to apply different Perl::Critic policy profiles for different paths in the repository. For example, you can be very strict with brand new projects, make an indulgence for legacy projects and completely disable Perl::Critic for auto-generated and third-party code.

The code and configuration file examples can be downloaded from here.

Discussion thread on PerlMonks

Who is who

Damian Conway - the author of "Perl Best Practices". The book on which Perl::Critic is mostly based. Jeffrey Thalhammer - the author of Perl::Critic module.

See also

Комментариев нет:

Отправить комментарий