The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

App-GitHooks

Build Status Coverage Status CPAN

App::GitHooks is an extensible and easy to configure git hooks framework that supports many plugins.

OVERVIEW

INSTALLATION

  1. Install this distribution (with cpanm or your preferred CPAN client):

    cpanm App::GitHooks
    
  2. Install the plugins you are interested in (with cpanmor your prefered CPAN client), as App::GitHooks does not bundle them. See the list of plugins below, but for example:

    cpanm App::GitHooks::Plugin::BlockNOCOMMIT
    cpanm App::GitHooks::Plugin::DetectCommitNoVerify
    ...
    
  3. Go to the git repository for which you want to set up git hooks, and run:

    githooks install
    
  4. Enjoy!

OFFICIALLY SUPPORTED PLUGINS

Prevent committing code with #NOCOMMIT mentions.

Prevent commits in a production environment.

Find out when someone uses --no-verify and append the pre-commit checks to the commit message.

Force running a specific tool at regular intervals.

Detect discrepancies between the ticket ID specified by the branch name and the one in the commit message.

Verify that Perl files compile without errors.

Verify that all changes and addition to the Perl files pass PerlCritic checks.

Enforce a specific Perl interpreter on the first line of Perl files.

Verify that the syntax of PgBouncer auth files is correct.

Derive a ticket ID from the branch name and prepend it to the commit-message.

Require a commit message.

Verify that staged Ruby files compile.

Validate POD format in Perl and POD files.

CONTRIBUTED PLUGINS

Verify that staged Ruby files compile.

Prevent trailing whitespace from being committed.

SUPPORT AND DOCUMENTATION

After installing, you can find documentation for this module with the perldoc command.

perldoc App::GitHooks

You can also look for information at:

LICENSE AND COPYRIGHT

Copyright (C) 2013-2015 Guillaume Aubert

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 3 as published by the Free Software Foundation.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/