App::GitHooks::StagedChanged - Staged changes in git.
Version 1.9.0
Instantiate a new App::GitHooks::StagedChanges object.
App::GitHooks::StagedChanges
my $staged_changes = App::GitHooks::StagedChanges->new( app => $app, );
Arguments:
app (mandatory)
An App::GitHook instance.
App::GitHook
Return the parent App::GitHooks object.
App::GitHooks
my $app = $staged_changes->get_app();
Verify the changes that are being committed.
This method returns an array composed of:
A boolean to indicate whether the checks passed or failed.
A boolean to indicate whether any warnings were displayed.
( $allow_commit, $has_warnings ) = $staged_changes->verify();
Verify that the files changed pass various rules.
A boolean to indicate whether the files passed the checks.
my ( $all_files_pass, $has_warnings ) = check_changed_files();
Verify that that a given file passes all the verification rules.
A boolean to indicate whether the file passed all the checks.
my ( $file_passes, $has_warnings ) = check_file( count => $count, file => $file, git_action => $git_action, total => $total, );
count (mandatory)
The number of the file in the list of files to check.
file (mandatory)
The path of the file to check.
git_action (mandatory)
The action performed by git on the file (add, delete, etc).
total (mandatory)
The total number of files to check as part of this git hooks instance.
Run in parallel the checks for a given file.
run_parallelized_checks( tests => $tests, file => $file, git_action => $git_action, );
tests
An arrayref of tests to run.
file
The path of the file being checked.
git_action
The type of action recorded by git on the file (deletion, addition, etc).
Format the output of a check against a file into a printable string.
format_check_output( app => $app, data => { name => $name, return_value => $return_value, error_message => $error_message, } );
Analyze the state of the repository to detect if the changes correspond to a merge or revert operation.
$staged_changes->analyze_changes();
Return true if the changes correspond to a git revert operation, false otherwise.
git revert
my $is_revert = $staged_changes->is_revert();
my $is_merge = $staged_changes->is_merge();
Please report any bugs or feature requests through the web interface at https://github.com/guillaumeaubert/App-GitHooks/issues/new. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
You can find documentation for this module with the perldoc command.
perldoc App::GitHooks::StagedChanges
You can also look for information at:
GitHub's request tracker
https://github.com/guillaumeaubert/App-GitHooks/issues
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/app-githooks
CPAN Ratings
http://cpanratings.perl.org/d/app-githooks
MetaCPAN
https://metacpan.org/release/App-GitHooks
Guillaume Aubert, <aubertg at cpan.org>.
<aubertg at cpan.org>
Copyright 2013-2017 Guillaume Aubert.
This code is free software; you can redistribute it and/or modify it under the same terms as Perl 5 itself.
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 LICENSE file for more details.
To install App::GitHooks, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::GitHooks
CPAN shell
perl -MCPAN -e shell install App::GitHooks
For more information on module installation, please visit the detailed CPAN module installation guide.