[libcode-tidyall-perl] 125/374: don't skip plugins
Jonas Smedegaard
js at alioth.debian.org
Sun Sep 29 22:26:02 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 0e1aa479d3532c7faca05ebd591d0c7287a0b452
Author: Jonathan Swartz <swartz at pobox.com>
Date: Fri Aug 3 15:42:10 2012 -0700
don't skip plugins
---
MANIFEST.SKIP | 1 -
bin/tidyall | 30 ++++++++++++++++++------------
lib/Code/TidyAll.pm | 1 -
3 files changed, 18 insertions(+), 14 deletions(-)
diff --git a/MANIFEST.SKIP b/MANIFEST.SKIP
index 8ca49a0..3d6b50f 100644
--- a/MANIFEST.SKIP
+++ b/MANIFEST.SKIP
@@ -13,7 +13,6 @@
^tmp
^weaver.ini
^z-backup
-^lib/Code/TidyAll/Plugin/Perl
~$
(^|/)#
diff --git a/bin/tidyall b/bin/tidyall
index 9730699..edd5f08 100755
--- a/bin/tidyall
+++ b/bin/tidyall
@@ -15,12 +15,12 @@ sub usage {
Pod::Usage::pod2usage( { verbose => 1 } );
}
-my ( %params, $help, $all, $inc_dirs );
+my ( %params, $all_files, $conf_file, $git_files, $help, $inc_dirs, $svn_files );
GetOptions(
'backup-ttl=i' => \$params{backup_ttl},
'check-only=s' => \$params{check_only},
- 'conf-file=s' => \$params{conf_file},
+ 'conf-file=s' => \$conf_file,
'data-dir=s' => \$params{data_dir},
'no-backups' => \$params{no_backups},
'no-cache' => \$params{no_cache},
@@ -28,9 +28,11 @@ GetOptions(
'refresh-cache' => \$params{refresh_cache},
'root-dir=s' => \$params{root_dir},
'tidyall-class=s' => \$params{tidyall_class},
- 'a|all' => \$all,
+ 'a|all' => \$all_files,
+ 'g|git' => \$git_files,
'h|help' => \$help,
'm|mode=s' => \$params{mode},
+ 's|svn' => \$svn_files,
'q|quiet' => \$params{quiet},
'v|verbose' => \$params{verbose},
'I' => \$inc_dirs,
@@ -42,20 +44,24 @@ unshift( @INC, split( /\s*,\s*/, $inc_dirs ) ) if defined($inc_dirs);
%params = slice_def( \%params );
-$params{conf_file} ||= "$params{root_dir}/tidyall.ini" if ( $params{root_dir} );
+$conf_file = "$params{root_dir}/tidyall.ini" if $params{root_dir};
+
+my $tidyall_class = $params{tidyall_class} || 'Code::TidyAll';
my @results;
-if ($all) {
- my $conf_file ||= Code::TidyAll->find_conf_file( cwd() );
- my $ct = Code::TidyAll->new_from_conf_file( $conf_file, %params );
- @results = $ct->process_all();
+if ($all_files || $svn_files || $git_files) {
+ my $conf_file = $tidyall_class->find_conf_file( cwd() );
+ my $ct = $tidyall_class->new_from_conf_file( $conf_file, %params );
+ my @files = ($all_files) ? $ct->matched_files : ($svn_files) ? Code::TidyAll::SVN->uncommitted_files() : ($git_files) ? Code::TidyAll::Git->uncommitted_files() : die;
}
-else {
- my @files = @ARGV or die "file(s) or -a required";
- my $conf_file ||= Code::TidyAll->find_conf_file( dirname( $files[0] ) );
- my $ct = Code::TidyAll->new_from_conf_file( $conf_file, %params );
+elsif (my @files = @ARGV) {
+ my $conf_file = $tidyall_class->find_conf_file( dirname( $files[0] ) );
+ my $ct = $tidyall_class->new_from_conf_file( $conf_file, %params );
@results = $ct->process_files(@files);
}
+else {
+ die "must pass -a, -s, -g, or filename(s)";
+}
my $status = ( grep { $_->error } @results ) ? 1 : 0;
exit($status);
diff --git a/lib/Code/TidyAll.pm b/lib/Code/TidyAll.pm
index 49e5f02..092dcc8 100644
--- a/lib/Code/TidyAll.pm
+++ b/lib/Code/TidyAll.pm
@@ -36,7 +36,6 @@ has 'backup_dir' => ( is => 'lazy', init_arg => undef, trigger => 1 );
has 'backup_ttl_secs' => ( is => 'lazy', init_arg => undef );
has 'base_sig' => ( is => 'lazy', init_arg => undef );
has 'cache' => ( is => 'lazy', init_arg => undef );
-has 'conf_file' => ( is => 'ro', init_arg => undef );
has 'plugin_objects' => ( is => 'lazy', init_arg => undef );
has 'plugins_for_mode' => ( is => 'lazy', init_arg => undef );
--
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