NAME
App::GitHooks::StagedChanged - Staged changes in git.
VERSION
Version 1.9.0
METHODS
new()
Instantiate a new App::GitHooks::StagedChanges
object.
my $staged_changes = App::GitHooks::StagedChanges->new(
app => $app,
);
Arguments:
app (mandatory)
An
App::GitHook
instance.
get_app()
Return the parent App::GitHooks
object.
my $app = $staged_changes->get_app();
verify()
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();
check_changed_files()
Verify that the files changed pass various rules.
This method returns an array composed of:
A boolean to indicate whether the files passed the checks.
A boolean to indicate whether any warnings were displayed.
my ( $all_files_pass, $has_warnings ) = check_changed_files();
check_file()
Verify that that a given file passes all the verification rules.
This method returns an array composed of:
A boolean to indicate whether the file passed all the checks.
A boolean to indicate whether any warnings were displayed.
my ( $file_passes, $has_warnings ) = check_file(
count => $count,
file => $file,
git_action => $git_action,
total => $total,
);
Arguments:
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_parallelized_checks()
Run in parallel the checks for a given file.
run_parallelized_checks(
tests => $tests,
file => $file,
git_action => $git_action,
);
Arguments:
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_check_output()
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_changes()
Analyze the state of the repository to detect if the changes correspond to a merge or revert operation.
$staged_changes->analyze_changes();
is_revert()
Return true if the changes correspond to a git revert
operation, false otherwise.
my $is_revert = $staged_changes->is_revert();
is_merge()
Return true if the changes correspond to a git revert
operation, false otherwise.
my $is_merge = $staged_changes->is_merge();
BUGS
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.
SUPPORT
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
AnnoCPAN: Annotated CPAN documentation
CPAN Ratings
MetaCPAN
AUTHOR
Guillaume Aubert, <aubertg at cpan.org>
.
COPYRIGHT & LICENSE
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.