![]() ![]() Having a log file is especially useful with pre-commit hooks since there is no way for the hook to send back output on a successful commit. Or do something fancier with one of the other Log::Any adapters. You can create a simple date-stamped log file with use Log::Any::Adapter (File => "/path/to/hooks/logs/tidyall.log") This module uses Log::Any to log its activity, including all files that were checked, an inability to find the configuration file, and any runtime errors that occur. Hashref of options to pass to the Code::TidyAll constructor ![]() Repository path being committed defaults to $ARGV If the configuration file cannot be found for some/all the files, or if a runtime error occurs, reject the commit. If you don't list them here then you'll get errors like 'cannot find perlcriticrc' when the hook runs. blank or undefined) to disable bypassing.Ī listref of other configuration files referred to from the main configuration file, e.g. svn commit -m "NO TIDYALL - must get fix to production!" Passes mode = "commit" by default see modes.Ĭonf file name to search for instead of the defaults.Ĭommit prefix that will cause this hook to be bypassed. This is so that unexpected problems do not prevent valid commits. For each file, the hook will look upwards from the file's repo location and use the first configuration file it finds.īy default, if the configuration file cannot be found, or if a runtime error occurs, a warning is logged (see "LOGGING" below) but the commit is allowed to proceed. % svn commit -m "NO TIDYALL - this is an emergency!" CHI.pm CHI/Driver.pm In an emergency the hook can be bypassed by prefixing the comment with "NO TIDYALL", e.g. Lib/CHI/Driver.pm: *** 'PerlCritic': Code before strictures are enabledĪt /tmp/Code-TidyAll-0e6K/Driver.pm line 2 Lib/CHI.pm: *** 'PerlTidy': needs tidying Svn: Commit blocked by pre-commit hook (exit code 255) with output: % svn commit -m "fixups" CHI.pm CHI/Driver.pm If not, then the entire commit is rejected and the reason(s) are output to the client. This class provides the following methods: Code::TidyAll::SVN::Precommit->check(%params)Ĭheck that all files being added or modified in this commit are tidied and valid according to tidyall. This module implements a Subversion pre-commit hook that checks if all files are tidied and valid according to tidyall, and rejects the commit if not. Use Log::Any::Adapter (File => '/path/to/hooks/logs/tidyall.log') Ĭode::TidyAll::SVN::Precommit->check() DESCRIPTION Version 0.83 SYNOPSIS In hooks/pre-commit in your svn repo: Code::TidyAll::SVN::Precommit->check(%params)Ĭode::TidyAll::SVN::Precommit - Subversion pre-commit hook that requires files to be tidyall'd VERSION. ![]()
0 Comments
Leave a Reply. |