Guillaume Aubert > Perl-Critic-Git-1.2.0 > Perl::Critic::Git

Download:
Perl-Critic-Git-1.2.0.tar.gz

Dependencies

Annotate this POD

Website

View/Report Bugs
Module Version: v1.2.0   Source   Latest Release: Perl-Critic-Git-v1.2.1

NAME ^

Perl::Critic::Git - Bond git and Perl::Critic to blame the right people for violations.

VERSION ^

Version 1.2.0

SYNOPSIS ^

        use Perl::Critic::Git;
        my $git_critic = Perl::Critic::Git->new(
                file   => $file,
                level  => $critique_level,         # or undef to use default profile
        );
        
        my $violations = $git_critic->report_violations(
                author => $author,                 # or undef for all
                since  => $date,                   # to critique only recent changes
        );

METHODS ^

new()

Create a new Perl::Critic::Git object.

        my $git_critic = Perl::Critic::Git->new(
                file   => $file,
                level  => $critique_level,         # or undef to use default profile
        );

Parameters:

get_authors()

Return an arrayref of all the authors found in git blame for the file analyzed.

        my $authors = $git_critic->get_authors();

report_violations()

Report the violations for a given Git author.

        my $violations = $git_critic->report_violations(
                author => $author,                 # or undef for all
                since  => $date,                   # to critique only recent changes
        );

Parameters:

force_reanalyzing()

Force reanalyzing the file specified by the current object. This is useful if the file has been modified since the Perl::Critic::Git object has been created.

        $git_critic->force_reanalyzing();

ACCESSORS ^

get_perlcritic_violations()

Return an arrayref of all the Perl::Critic::Violation objects found by running Perl::Critic on the file specified by the current object.

        my $perlcritic_violations = $git_critic->get_perlcritic_violations();

get_blame_lines()

Return an arrayref of Git::Repository::Plugin::Blame::Line objects corresponding to the lines in the file analyzed.

        my $blame_lines = $self->get_blame_lines();

get_blame_line()

Return a Git::Repository::Plugin::Blame::Line object corresponding to the line number passed as parameter.

        my $blame_line = $git_critic->get_blame_line( 5 );

INTERNAL METHODS ^

_analyze_file()

Run "git blame" and "PerlCritic" on the file specified by the current object and caches the results to speed reports later.

        $git_critic->_analyze_file();

Arguments:

_is_analyzed()

Return whether the file specified by the current object has already been analyzed with "git blame" and "PerlCritic".

        my $is_analyzed = $git_critic->_is_analyzed();

_get_file()

Return the path to the file to analyze for the current object.

        my $file = $git_critic->_get_file();

_get_critique_level()

Return the critique level selected when creating the current object.

        my $critique_level = $git_critic->_get_critique_level();

BUGS ^

Please report any bugs or feature requests through the web interface at https://github.com/guillaumeaubert/Perl-Critic-Git/issues. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT ^

You can find documentation for this module with the perldoc command.

        perldoc Perl::Critic::Git

You can also look for information at:

AUTHOR ^

Guillaume Aubert, <aubertg at cpan.org>.

ACKNOWLEDGEMENTS ^

I originally developed this project for ThinkGeek (http://www.thinkgeek.com/). Thanks for allowing me to open-source it!

COPYRIGHT & LICENSE ^

Copyright 2012-2013 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/

syntax highlighting: