App-githook-perltidy

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

0.11.3_2 (2016-05-21)

    Dependencies:
        - Don't use the defined-or "//" operator - min perl version
          5.6.

0.11.3_1 (2016-05-20)

    Bug Fixes:
       - Fix license typo in Makefile.PL (Mohammad S Anwar)
       - Replace backup/recover (stash/pop) implementation with setting
         GIT_WORK_TREE to a temporary directory. This should fix
         https://github.com/mlawren/githook-perltidy/issues/8.

0.11.2 (2016-01-20)

    New Features:
        - Added a "--force" option to install, to overwrite existing
          git hooks

    Enhancements:

lib/App/githook/perltidy/pre_commit.pm  view on Meta::CPAN

    my $where    = shift;

    state $req = require Pod::Tidy;
    $status = "(podtidy) ($where)";

    Pod::Tidy::tidy_files(
        files     => [$tmp_file],
        recursive => 0,
        verbose   => 0,
        inplace   => 1,
        nobackup  => 1,
        columns   => 72,
        %{ $self->podtidyrc_opts },
    );
}

sub critic_perl {
    my $self     = shift;
    my $tmp_file = shift || die 'critic_perl($TMP_FILE, $file)';
    my $file     = shift || die 'critic_perl($tmp_file, $FILE)';
    my $where    = shift;

t/githook-perltidy.t  view on Meta::CPAN

                argv       => [ qw{-nst -b -bext=/}, "$dest.perlpodtidy" ],
                errorfile  => \$errormsg,
                perltidyrc => $srcdir->child('perltidyrc')->stringify,
            );

            Pod::Tidy::tidy_files(
                files     => [ $dest . '.perlpodtidy' ],
                recursive => 0,
                verbose   => 0,
                inplace   => 1,
                nobackup  => 1,
                columns   => 72,
                %$pod_opts,
            );
        }
        else {
            copy( $dest, $dest . '.perltidy' ) or die "copy: $!";

            Perl::Tidy::perltidy(
                argv       => [ qw{-nst -b -bext=/}, "$dest.perltidy" ],
                errorfile  => \$errormsg,

t/githook-perltidy.t  view on Meta::CPAN

                argv       => [ qw{-nst -b -bext=/}, "$dest.perlspodtidy" ],
                errorfile  => \$errormsg,
                perltidyrc => $srcdir->child('perltidyrc')->stringify,
            );

            Pod::Tidy::tidy_files(
                files     => [ $dest . '.perlspodtidy' ],
                recursive => 0,
                verbose   => 0,
                inplace   => 1,
                nobackup  => 1,
                columns   => 72,
                %$pod_opts,
            );
        }
        else {
            copy( $dest, $dest . '.perlstidy' ) or die "copy: $!";

            Perl::Tidy::Sweetened::perltidy(
                argv       => [ qw{-nst -b -bext=/}, "$dest.perlstidy" ],
                errorfile  => \$errormsg,

t/githook-perltidy.t  view on Meta::CPAN

    }

    if ( -e '.podtidy-opts' ) {
        copy( $dest, $dest . '.podtidy' ) or die "copy: $!";

        Pod::Tidy::tidy_files(
            files     => [ $dest . '.podtidy' ],
            recursive => 0,
            verbose   => 0,
            inplace   => 1,
            nobackup  => 1,
            columns   => 72,
            %$pod_opts,
        );
    }
}

sub add_commit {
    my $file = shift || die 'add_commit($FILE)';

    run( qw!git add!,       $file );



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