Git::Lint::Check::Message - parent module for message check modules
use parent 'Git::Lint::Check::Message'; # inside of the child module, check method sub check { my $self = shift; my $input = shift; my $match = sub { my $lines_arref = shift; my $summary = shift @{$lines_arref}; return 1 if length $summary > SUMMARY_LENGTH; return; }; my @issues = $self->parse( input => $input, match => $match, check => $check_message, ); return @issues; }
Git::Lint::Check::Message provides methods for Git::Lint message check modules.
Git::Lint::Check::Message
This module is not meant to be initialized directly.
To add check functionality to Git::Lint, additional check modules can be created as child modules to Git::Lint::Check::Message.
For an example to start creating message check modules, see Git::Lint::Check::Message::SummaryLength or any message check module released within this distribution.
Child modules must implement the check method which gathers, formats, and returns a list of issues.
check
The methods within this module can be used to parse and report the issues in the expected format, but are not required to be used.
The issues returned from message check modules must be a list of hash refs each with a message key and value.
my @issues = ( { message => 'summary length (50 characters of less)' } );
This method is inherited from Git::Lint::Check.
Reads the input commit message from file and returns the contents.
An array ref of the commit message input.
Formats the match information into the expected issue format.
The check name or message to format.
A hash ref with the message key and value.
Parses the commit message input for violations using the match subref check.
Array ref of the message input to check.
Code ref (sub reference) containing the check logic.
The check name or message to use for reporting issues.
A list of hashrefs of formatted issues.
To install Git::Lint, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Git::Lint
CPAN shell
perl -MCPAN -e shell install Git::Lint
For more information on module installation, please visit the detailed CPAN module installation guide.