Skip to content

Commit e88f793

Browse files
committed
Tidy all code with the latest Perl::Tidy
1 parent a2e32cd commit e88f793

File tree

10 files changed

+22
-22
lines changed

10 files changed

+22
-22
lines changed

bin/tidyall

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ else {
152152
}
153153

154154
my @results = $ct->process_paths(@paths);
155-
my $status = ( grep { $_->error } @results ) ? 1 : 0;
155+
my $status = ( grep { $_->error } @results ) ? 1 : 0;
156156
exit($status);
157157

158158
sub handle_pipe {
@@ -162,7 +162,7 @@ sub handle_pipe {
162162
$params{$_} = 0 for ('verbose');
163163

164164
$conf_file ||= $tidyall_class->find_conf_file( \@conf_names, $pipe_filename->parent );
165-
my $ct = $tidyall_class->new_from_conf_file( $conf_file, %params );
165+
my $ct = $tidyall_class->new_from_conf_file( $conf_file, %params );
166166
my $source = do { local $/; <STDIN> };
167167

168168
# Merge stdout and stderr and output all to stderr, so that stdout is

lib/Code/TidyAll.pm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ sub _build_backup_ttl_secs {
214214
}
215215

216216
sub _build_base_sig {
217-
my $self = shift;
217+
my $self = shift;
218218
my $active_plugins = join( q{|}, map { $_->name } @{ $self->_plugin_objects } );
219219
return $self->_sig( [ $Code::TidyAll::VERSION || 0, $active_plugins ] );
220220
}
@@ -238,7 +238,7 @@ sub _build_plugins_to_run {
238238
my $self = shift;
239239

240240
my $all_plugins = $self->plugins;
241-
my %selected = map { $_ => 1 } @{ $self->selected_plugins };
241+
my %selected = map { $_ => 1 } @{ $self->selected_plugins };
242242
my %plugins;
243243

244244
if (%selected) {
@@ -565,7 +565,7 @@ sub process_file {
565565
}
566566

567567
my $contents = $cache_model->file_contents || $full_path->slurp;
568-
my $result = $self->process_source( $contents, $path );
568+
my $result = $self->process_source( $contents, $path );
569569

570570
if ( $result->state eq 'tidied' ) {
571571

lib/Code/TidyAll/Git/Prereceive.pm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ sub check_input {
116116
sub create_tidyall {
117117
my ( $self, $commit ) = @_;
118118

119-
my $temp_dir = tempdir_simple();
119+
my $temp_dir = tempdir_simple();
120120
my @conf_names = $self->conf_name ? ( $self->conf_name ) : Code::TidyAll->default_conf_names;
121121
my ($conf_file) = grep { $self->get_file_contents( $_, $commit ) } @conf_names
122122
or die sprintf( 'could not find conf file %s', join( ' or ', @conf_names ) );
@@ -140,7 +140,7 @@ sub create_tidyall {
140140
sub get_changed_files {
141141
my ( $self, $base, $commit ) = @_;
142142
my $output = capturex( $self->git_path, 'diff', '--numstat', '--name-only', "$base..$commit" );
143-
my @files = grep {/\S/} split( "\n", $output );
143+
my @files = grep {/\S/} split( "\n", $output );
144144
return @files;
145145
}
146146

lib/Code/TidyAll/Role/RunsCommand.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ sub _run_or_die {
3636
my $signal = $? & 127;
3737
my $msg = "exited with $code";
3838
$msg .= " - received signal $signal" if $signal;
39-
$msg .= " - output was:\n$output" if defined $output and length $output;
39+
$msg .= " - output was:\n$output" if defined $output and length $output;
4040
die "$msg\n";
4141
}
4242
}

lib/Code/TidyAll/SVN/Precommit.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ sub check {
6363
my %conf_files;
6464
foreach my $file (@files) {
6565
if ( my $conf_file = $self->find_conf_for_file($file) ) {
66-
my $root = $conf_file->parent;
66+
my $root = $conf_file->parent;
6767
my $rel_file = substr( $file, length($root) + 1 );
6868
$conf_files{$conf_file}->{$rel_file}++;
6969
}

lib/Code/TidyAll/SVN/Util.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ sub svn_uncommitted_files {
1717

1818
$dir = realpath($dir);
1919
my $output = capturex( 'svn', 'status', $dir );
20-
my @lines = grep {/^[AM]/} split( "\n", $output );
20+
my @lines = grep {/^[AM]/} split( "\n", $output );
2121
my (@files) = grep {-f} ( $output =~ m{^[AM]\s+(.*)$}gm );
2222
return @files;
2323
}

t/lib/TestFor/Code/TidyAll/Basic.pm

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ sub test_filemode : Tests {
108108
}
109109

110110
my $root_dir = $self->create_dir( { 'foo.txt' => 'abc' } );
111-
my $file = $root_dir->child('foo.txt');
111+
my $file = $root_dir->child('foo.txt');
112112
$file->chmod('0755');
113113
my $ct = Code::TidyAll->new(
114114
plugins => { test_plugin('UpperText') => { select => '**/foo*' } },
@@ -147,7 +147,7 @@ sub test_plugin_order_and_atomicity : Tests {
147147
# note without the weight here this would run first, and the
148148
# letters in the photetic words themselves would be reversed
149149
test_plugin('AlwaysPhonetic') => { select => '**/*.txt', weight => 51 }
150-
)
150+
)
151151
} ( 1 .. 3 );
152152

153153
$self->tidy(
@@ -176,7 +176,7 @@ sub test_quiet_and_verbose : Tests {
176176
foreach my $state ( 'normal', 'quiet', 'verbose' ) {
177177
foreach my $error ( 0, 1 ) {
178178
my $root_dir = $self->create_dir( { 'foo.txt' => ( $error ? '123' : 'abc' ) } );
179-
my $output = capture_stdout {
179+
my $output = capture_stdout {
180180
my $ct = Code::TidyAll->new(
181181
plugins => {%UpperText},
182182
root_dir => $root_dir,
@@ -235,7 +235,7 @@ sub test_caching_and_backups : Tests {
235235
my $desc
236236
= "(no_cache=$no_cache, no_backups=$no_backups, model=$cache_model_class, cache_class=$chi)";
237237
my $root_dir = $self->create_dir( { 'foo.txt' => 'abc' } );
238-
my $ct = Code::TidyAll->new(
238+
my $ct = Code::TidyAll->new(
239239
plugins => {%UpperText},
240240
root_dir => $root_dir,
241241
cache_model_class => $cache_model_class,
@@ -245,7 +245,7 @@ sub test_caching_and_backups : Tests {
245245
);
246246
my $output;
247247
my $file = path( $root_dir, 'foo.txt' );
248-
my $go = sub {
248+
my $go = sub {
249249
$output = capture_stdout { $ct->process_paths($file) };
250250
};
251251

@@ -314,7 +314,7 @@ sub test_selects_and_ignores : Tests {
314314

315315
my @files = ( 'a/foo.pl', 'b/foo.pl', 'a/foo.pm', 'a/bar.pm', 'b/bar.pm' );
316316
my $root_dir = $self->create_dir( { map { $_ => 'hi' } @files } );
317-
my $ct = Code::TidyAll->new(
317+
my $ct = Code::TidyAll->new(
318318
root_dir => $root_dir,
319319
plugins => {
320320
test_plugin('UpperText') => {
@@ -453,7 +453,7 @@ sub test_errors : Tests {
453453
}
454454
qr/unknown options/;
455455

456-
my $ct = Code::TidyAll->new( plugins => {%UpperText}, root_dir => $root_dir );
456+
my $ct = Code::TidyAll->new( plugins => {%UpperText}, root_dir => $root_dir );
457457
my $output = capture_stdout { $ct->process_paths("$root_dir/baz/blargh.txt") };
458458
like( $output, qr/baz\/blargh.txt: not a file or directory/, 'file not found' );
459459

t/lib/TestFor/Code/TidyAll/Git.pm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ sub test_git : Tests {
7575
};
7676

7777
my $prereceive_hook_file = $shared_dir->child(qw( hooks pre-receive ));
78-
my $prereceive_hook = sprintf( $prereceive_hook_template, $self->_lib_dirs );
78+
my $prereceive_hook = sprintf( $prereceive_hook_template, $self->_lib_dirs );
7979
$prereceive_hook_file->spew($prereceive_hook);
8080
$prereceive_hook_file->chmod(0775);
8181

@@ -299,7 +299,7 @@ sub _make_working_dir_and_repo {
299299
runx(qw( git commit -q -m added tidyall.ini .gitignore ));
300300

301301
my $precommit_hook_file = $hooks_dir->child('pre-commit');
302-
my $precommit_hook = sprintf( $precommit_hook_template, $self->_lib_dirs );
302+
my $precommit_hook = sprintf( $precommit_hook_template, $self->_lib_dirs );
303303
$precommit_hook_file->spew($precommit_hook);
304304
$precommit_hook_file->chmod(0755);
305305

t/lib/TestFor/Code/TidyAll/SVN.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ sub test_svn : Tests {
5757
cmp_deeply( [ svn_uncommitted_files($work_dir) ], [], 'no uncommitted files' );
5858

5959
my $precommit_hook_file = $hooks_dir->child('pre-commit');
60-
my $precommit_hook = sprintf( $precommit_hook_template, path('lib')->realpath, $hook_log );
60+
my $precommit_hook = sprintf( $precommit_hook_template, path('lib')->realpath, $hook_log );
6161
$precommit_hook_file->spew($precommit_hook);
6262
$precommit_hook_file->chmod(0755);
6363

t/lib/TestHelper/Test/Class.pm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,14 @@ sub tidy {
4343
my $root_dir = $self->create_dir( $params{source} );
4444

4545
my $options = $params{options} || {};
46-
my $ct = Code::TidyAll->new(
46+
my $ct = Code::TidyAll->new(
4747
plugins => $params{plugins},
4848
root_dir => $root_dir,
4949
%$options
5050
);
5151

5252
my @results;
53-
my $output = capture_stdout { @results = $ct->process_all() };
53+
my $output = capture_stdout { @results = $ct->process_all() };
5454
my $error_count = grep { $_->error } @results;
5555
if ( $params{errors} ) {
5656
ok( $error_count > 0, "$desc - error_count > 0" );

0 commit comments

Comments
 (0)