in reply to Using Perl::Critic in Subversion hook script

As one of the Perl::Critic developers, I say don't do this. This is a Bad Idea. My hard drive is going down and I want to commit just to back up and you're going to block me from doing it? Source control is there to save your state; if the state is bad, you can always go back a revision. More here.

Replies are listed 'Best First'.
Re: Don't do this.
by xdr (Acolyte) on Feb 17, 2010 at 13:43 UTC

    I agree that there are situations when you *do* need to commit changes. That's why I've added new feature to the perlcritic-checker: emergency commits. The idea is very simple: when you are in a hurry, just place "magic" prefix in the beginning of the commit log message, e.g.:

    svn ci -m "NO CRITIC: I am in hurry" FooBar.pm

    This commit will bypass all checks. This code is not released yet, but I am in process of doing it.

    I've also implemented so-called "progressive mode" just like in Test::Perl::Critic::Progressive module but without history files. Current commit is compared to the previous one on the fly. This way perlcritic-checker doesn't complain about existing violations but prevents introducing new ones.