NAME
Test::Perl::Critic::Git - Test module to run perl critic on changed git files
VERSION
Version 0.000200
SUBROUTINES/METHODS
critic_on_changed_ok
Run perl critic on changed files and and raises errors, or even not :-D
Params:
Arrayref of String from directories which should be tested in the git-project.
critic_on_changed_not_ok
Same as critic_on_changed_ok but vice versa
import
Params:
Hash-Ref: direct import params for Perl::Critic Hash-Ref: direct import params for Git Hash-Ref: params in which conditions should be checked.
SYNOPSIS
eval "use Test::Perl::Critic::Git";
plan skip_all => "Test::Perl::Critic::Git required for testing perl critic" if $@;
Test::Perl::Critic::Git->import({
-severity => 'brutal',
-profile => File::Spec->catfile($Bin, 'critic', 'profilerc'),
...
});
or
Test::Perl::Critic::Git->import(
{
-severity => 'brutal',
-profile => File::Spec->catfile($Bin, 'critic', 'profilerc'),
...
},
{
Directory => '/srv/git/cogito.git'
}
);
or
Test::Perl::Critic::Git->import(
{
-severity => 'brutal',
-profile => File::Spec->catfile($Bin, 'critic', 'profilerc'),
...
}, {},
# do not test pl files and unit tests
{
exclude => ['pl','t']
}
);
critic_on_changed_ok([
'.',
...
]);
critic_on_changed_ok( ['.'], 'critic_on_changed_ok test' );
critic_on_changed_not_ok( ['.'], 'critic_on_changed_not_ok test' );
DIAGNOSTICS
DEPENDENCIES
Internal usage
Carp, Git::Diff, Perl::Critic, Test::Builder, Perl::Critic::Utils, Perl::Critic::Violation
INCOMPATIBILITIES
BUGS AND LIMITATIONS
A list of current bugs and issues can be found at the CPAN site
https://gitlab.com/mziescha/test-perl-critic-git/issues
To report a new bug or problem, use the link on this page.
DESCRIPTION
Test module to run perl critic on changed git files
CONFIGURATION AND ENVIRONMENT
configurable by import sub
AUTHOR
Mario Zieschang, <mziescha at cpan.org>