Code-TidyAll

 view release on metacpan or  search on metacpan

lib/Code/TidyAll/SVN/Precommit.pm  view on Meta::CPAN

=head1 Code::TidyAll::SVN::Precommit->check(%params)

Check that all files being added or modified in this commit are tidied and
valid according to L<tidyall>. If not, then the entire commit is rejected and
the reason(s) are output to the client. e.g.

    % svn commit -m "fixups" CHI.pm CHI/Driver.pm
    Sending        CHI/Driver.pm
    Sending        CHI.pm
    Transmitting file data ..svn: Commit failed (details follow):
    svn: Commit blocked by pre-commit hook (exit code 255) with output:
    2 files did not pass tidyall check
    lib/CHI.pm: *** 'PerlTidy': needs tidying
    lib/CHI/Driver.pm: *** 'PerlCritic': Code before strictures are enabled
      at /tmp/Code-TidyAll-0e6K/Driver.pm line 2
      [TestingAndDebugging::RequireUseStrict]

In an emergency the hook can be bypassed by prefixing the comment with "NO
TIDYALL", e.g.

    % svn commit -m "NO TIDYALL - this is an emergency!" CHI.pm CHI/Driver.pm

php/PHP_CodeSniffer/src/Runner.php  view on Meta::CPAN

            $this->config->generator    = null;
            $this->config->explain      = false;
            $this->config->interactive  = false;
            $this->config->cache        = false;
            $this->config->showSources  = false;
            $this->config->recordErrors = false;
            $this->config->reportFile   = null;
            $this->config->reports      = ['cbf' => null];

            // If a standard tries to set command line arguments itself, some
            // may be blocked because PHPCBF is running, so stop the script
            // dying if any are found.
            $this->config->dieOnUnknownArg = false;

            $this->run();
            $this->reporter->printReports();

            echo PHP_EOL;
            Util\Timing::printRunTime();
        } catch (DeepExitException $e) {
            echo $e->getMessage();



( run in 0.443 second using v1.01-cache-2.11-cpan-49f99fa48dc )