[libcode-tidyall-perl] 176/374: add extra_conf_files
Jonas Smedegaard
js at alioth.debian.org
Sun Sep 29 22:26:13 UTC 2013
This is an automated email from the git hooks/post-receive script.
js pushed a commit to branch master
in repository libcode-tidyall-perl.
commit c7d6676ce620e1093b43e6a91fcb9e4f79b1d21a
Author: Jonathan Swartz <swartz at pobox.com>
Date: Tue Sep 4 23:18:28 2012 -0700
add extra_conf_files
---
lib/Code/TidyAll/Git/Prereceive.pm | 22 ++++++++++++----------
1 file changed, 12 insertions(+), 10 deletions(-)
diff --git a/lib/Code/TidyAll/Git/Prereceive.pm b/lib/Code/TidyAll/Git/Prereceive.pm
index 4ae4c45..1b86d2b 100644
--- a/lib/Code/TidyAll/Git/Prereceive.pm
+++ b/lib/Code/TidyAll/Git/Prereceive.pm
@@ -7,11 +7,12 @@ use SVN::Look;
use Try::Tiny;
# Public
-has 'conf_file' => ( is => 'ro', default => sub { "tidyall.ini" } );
-has 'git_path' => ( is => 'ro', default => sub { 'git' } );
-has 'reject_on_error' => ( is => 'ro' );
-has 'tidyall_class' => ( is => 'ro', default => sub { "Code::TidyAll" } );
-has 'tidyall_options' => ( is => 'ro', default => sub { {} } );
+has 'conf_file' => ( is => 'ro', default => sub { "tidyall.ini" } );
+has 'extra_conf_files' => ( is => 'ro', default => sub { [] } );
+has 'git_path' => ( is => 'ro', default => sub { 'git' } );
+has 'reject_on_error' => ( is => 'ro' );
+has 'tidyall_class' => ( is => 'ro', default => sub { "Code::TidyAll" } );
+has 'tidyall_options' => ( is => 'ro', default => sub { {} } );
sub check {
my ( $class, %params ) = @_;
@@ -63,12 +64,13 @@ sub create_tidyall {
my ( $self, $commit ) = @_;
my $temp_dir = tempdir_simple();
- my $conf_contents = $self->get_file_contents( $self->conf_file, $commit )
- or die sprintf( "could not find conf file '%s' in repo root", $self->conf_file );
- my $conf_file = "$temp_dir/tidyall.ini";
- write_file( $conf_file, $conf_contents );
+ foreach my $rel_file ( $self->conf_file, @{ $self->extra_conf_files } ) {
+ my $contents = $self->get_file_contents( $rel_file, $commit )
+ or die sprintf( "could not find file '%s' in repo root", $rel_file );
+ write_file( "$temp_dir/$rel_file", $contents );
+ }
my $tidyall = $self->tidyall_class->new_from_conf_file(
- $conf_file,
+ "$temp_dir/" . $self->conf_file,
mode => 'commit',
quiet => 1,
%{ $self->tidyall_options },
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libcode-tidyall-perl.git
More information about the Pkg-perl-cvs-commits
mailing list