Skip to content

Commit e220cfe

Browse files
committed
Removed -st from .perltidyrc (that is surely an uncontroversial improvement...)
Tidied everything using the reverted .perltidyrc.
1 parent c882bc8 commit e220cfe

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+398
-500
lines changed

.perltidyrc

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
-l=78 # max line width is 78 columns
33
-i=4 # indent level is 4 columns
44
-ci=2 # continuation indent is 2 columns
5-
-st # output to STDOUT
65
-se # errors to STDERR
76
-vt=2 # minimum vertical tightness
87
-cti=0 # no extra indentation for closing brackets

Build.PL

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use Module::Build;
33
use 5.005;
44

55
use File::Spec;
6-
use lib 'inc', File::Spec->canonpath('lib/'); # use our self to install
6+
use lib 'inc', File::Spec->canonpath('lib/'); # use our self to install
77

88
use MyBuilder;
99

benchmark/by_stage.pl

+1-2
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,7 @@
5858
{
5959
my $delta = $cur_time - $base_time;
6060
my $color
61-
= (
62-
abs($delta) > ( $cur_time + $base_time ) / 50 )
61+
= ( abs($delta) > ( $cur_time + $base_time ) / 50 )
6362
? ( $delta > 0 )
6463
? RED
6564
: GREEN

benchmark/historical.pl

+7-9
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,7 @@
8989
my @lines = split( /\n/, $data );
9090

9191
# the last (only) yaml marker
92-
my @markers
93-
= grep( { $lines[$_] =~ m/^---(?:\s|$)/ } 0 .. $#lines );
92+
my @markers = grep( { $lines[$_] =~ m/^---(?:\s|$)/ } 0 .. $#lines );
9493
my @yaml = map( { $lines[$_] } $markers[-1] .. $#lines );
9594
my ($hash) = YAML::Load( join( "\n", @yaml, '' ) );
9695
if ( $rev eq 'prove' ) {
@@ -172,8 +171,8 @@
172171
sub check_cache {
173172
my ($cached_file) = @_;
174173
if ( -e $cached_file ) {
175-
open( my $fh, '<', $cached_file ) or
176-
die "cannot open cache $cached_file $!";
174+
open( my $fh, '<', $cached_file )
175+
or die "cannot open cache $cached_file $!";
177176
my $data = do { local $/; <$fh> };
178177
return ($data);
179178
}
@@ -191,19 +190,18 @@ sub run_rev {
191190
IPC::Run::run(
192191
[@command],
193192
'>' =>
194-
sub { $out .= join( '', @_ ); print $fh @_; print @_ }, # tee
193+
sub { $out .= join( '', @_ ); print $fh @_; print @_ }, # tee
195194
'2>' => \$err,
196-
) or
197-
die "now what $? $! $err";
195+
) or die "now what $? $! $err";
198196
chdir($basedir) or die $!;
199197
return ($out);
200198
}
201199

202200
sub do_svn {
203201
my @command = @_;
204202
$ENV{NOSVN} and return;
205-
system( 'svn', @command ) and
206-
die "svn @command failed $? $!";
203+
system( 'svn', @command )
204+
and die "svn @command failed $? $!";
207205
}
208206

209207
# vim:ts=4:sw=4:et:sta

benchmark/prove_vs_runtests-raw.pl

+13-13
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@
3030
'named!',
3131
'prove!',
3232
'runtests!',
33-
) or
34-
die "bad options";
33+
) or die "bad options";
3534

3635
if (0) { # header
3736
my @mods = qw(
@@ -55,30 +54,32 @@
5554

5655
# for historical benchmarks
5756
# (because we renamed this, but had both once)
58-
my $prove_or_runtests
59-
= ( -e 'bin/runtests' ? 'bin/runtests' : 'bin/prove' );
57+
my $prove_or_runtests = ( -e 'bin/runtests' ? 'bin/runtests' : 'bin/prove' );
6058

6159
my $tmp_dir = File::Temp::tempdir(
6260
'tapx-' . 'X' x 8,
6361
TMPDIR => 1,
6462
CLEANUP => 1,
65-
) .
66-
'/';
63+
) . '/';
6764

6865
my $pwd = Cwd::getcwd();
6966
chdir($tmp_dir) or die "cannot get into $tmp_dir $!";
7067
mkdir('t') or die "cannot create t directory $!";
7168

7269
# just checking raw output handling speed
7370
my $thetest
74-
= 'my $n = ' . $knobs{num_lines} . ';' . q(print "1..$n\n";) .
75-
q(print "ok $_) . ( $knobs{named} ? ' whee' : '' ) .
76-
q(\n" for (1..$n);) . q(# print "#$0";);
71+
= 'my $n = '
72+
. $knobs{num_lines} . ';'
73+
. q(print "1..$n\n";)
74+
. q(print "ok $_)
75+
. ( $knobs{named} ? ' whee' : '' )
76+
. q(\n" for (1..$n);)
77+
. q(# print "#$0";);
7778

7879
for my $num ( 1 .. $knobs{num_test_files} ) {
7980
my $testfile = sprintf( 't/%02d-test.t', $num );
80-
open( my $fh, '>', $testfile ) or
81-
die "cannot open '$testfile' for writing $!";
81+
open( my $fh, '>', $testfile )
82+
or die "cannot open '$testfile' for writing $!";
8283
print $fh $thetest;
8384
}
8485

@@ -132,8 +133,7 @@ sub time_this {
132133
}
133134

134135
my $res = {
135-
( $knobs{prove}
136-
? time_this( prove => sub { system(@prove) and die; } )
136+
( $knobs{prove} ? time_this( prove => sub { system(@prove) and die; } )
137137
: ()
138138
),
139139
( $knobs{runtests}

examples/bin/tprove_gtk

+13-11
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,10 @@ if (@ARGV) {
3636
@tests = @ARGV;
3737
}
3838
else {
39-
find( sub { -f && /\.t$/ && push @tests => $File::Find::name },
40-
"t" );
39+
find(
40+
sub { -f && /\.t$/ && push @tests => $File::Find::name },
41+
"t"
42+
);
4143
}
4244

4345
pipe( my $reader, my $writer );
@@ -206,12 +208,12 @@ sub create_view {
206208

207209
my $model = Gtk2::ListStore->new(
208210

209-
# filename total run pass fail skip todo
211+
# filename total run pass fail skip todo
210212
qw(Glib::String Glib::Int Glib::Int Glib::Int Glib::Int Glib::Int Glib::Int)
211213
);
212214
my $view = Gtk2::TreeView->new($model);
213215

214-
# ------------------------------------------------------------------------- #
216+
# ------------------------------------------------------------------------- #
215217

216218
my $column_filename = Gtk2::TreeViewColumn->new_with_attributes(
217219
"Filename",
@@ -222,7 +224,7 @@ sub create_view {
222224
$column_filename->set_expand(TRUE);
223225
$view->append_column($column_filename);
224226

225-
# ------------------------------------------------------------------------- #
227+
# ------------------------------------------------------------------------- #
226228

227229
my $renderer_progress = Gtk2::CellRendererProgress->new();
228230
my $column_progress = Gtk2::TreeViewColumn->new_with_attributes(
@@ -261,7 +263,7 @@ sub create_view {
261263
);
262264
$view->append_column($column_progress);
263265

264-
# ------------------------------------------------------------------------- #
266+
# ------------------------------------------------------------------------- #
265267

266268
my @count_columns = (
267269
[ "Pass", COLUMN_PASS ],
@@ -285,7 +287,7 @@ sub create_view {
285287
$view->append_column($column);
286288
}
287289

288-
# ------------------------------------------------------------------------- #
290+
# ------------------------------------------------------------------------- #
289291

290292
$scroller->add($view);
291293
$vbox->pack_start( $scroller, TRUE, TRUE, 0 );
@@ -310,8 +312,7 @@ sub _callback_reader {
310312
if ( $condition & "in" || $condition & "pri" ) {
311313
my $data = <$reader>;
312314

313-
if ( $data !~
314-
/^[^\t]+ \t \d+ \t \d+ \t \d+ \t \d+ \t \d+ \t \d+$/x )
315+
if ( $data !~ /^[^\t]+ \t \d+ \t \d+ \t \d+ \t \d+ \t \d+ \t \d+$/x )
315316
{
316317
return TRUE;
317318
}
@@ -461,8 +462,9 @@ sub analyze {
461462
}
462463

463464
else {
464-
warn "Unknown result type `" . $line->type() . "´: " .
465-
$line->as_string();
465+
warn "Unknown result type `"
466+
. $line->type() . "´: "
467+
. $line->as_string();
466468
}
467469

468470
my $string = join "\t", $test, @{$result};

lib/App/Prove.pm

+6-7
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,7 @@ sub process_args {
136136
? App::Prove::Plugins->switches
137137
: ()
138138
),
139-
) or
140-
croak('Unable to continue');
139+
) or croak('Unable to continue');
141140

142141
# Stash the remainder of argv for later
143142
$self->{argv} = [@ARGV];
@@ -155,8 +154,9 @@ sub _help {
155154
# XXX Getopt::Long is being helpy
156155
local $SIG{__DIE__} = sub { warn @_; $self->_exit; };
157156
if ($err) {
158-
die 'Please install Pod::Usage for the --help option ' .
159-
'(or try `perldoc prove`.)' . "\n ($@)";
157+
die 'Please install Pod::Usage for the --help option '
158+
. '(or try `perldoc prove`.)'
159+
. "\n ($@)";
160160
}
161161

162162
Pod::Usage::pod2usage( { -verbose => 1 } );
@@ -184,7 +184,7 @@ sub _get_args {
184184
}
185185

186186
if ( $self->archive ) {
187-
eval("sub TAP::Harness::Archive::auto_inherit {1}"); # wink,wink
187+
eval("sub TAP::Harness::Archive::auto_inherit {1}"); # wink,wink
188188
$self->require_harness( archive => 'TAP::Harness::Archive' );
189189
$args{archive} = $self->archive;
190190
}
@@ -235,8 +235,7 @@ sub _get_args {
235235

236236
$args{errors} = 1 if $self->parse;
237237

238-
$args{exec}
239-
= length( $self->exec ) ? [ split( / /, $self->exec ) ] : []
238+
$args{exec} = length( $self->exec ) ? [ split( / /, $self->exec ) ] : []
240239
if ( defined( $self->exec ) );
241240

242241
if ($formatter_class) {

lib/TAP/Base.pm

+3-6
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,7 @@ sub _initialize {
6666
$self->{ok_callbacks} = \%ok_map;
6767

6868
if ( exists $arg_for->{callbacks} ) {
69-
while ( my ( $event, $callback )
70-
= each %{ $arg_for->{callbacks} } )
71-
{
69+
while ( my ( $event, $callback ) = each %{ $arg_for->{callbacks} } ) {
7270
$self->callback( $event, $callback );
7371
}
7472
}
@@ -90,9 +88,8 @@ sub callback {
9088
$self->_croak('No callbacks may be installed')
9189
unless %ok_map;
9290

93-
$self->_croak(
94-
"Callback $event is not supported. Valid callbacks are " .
95-
join( ', ', sort keys %ok_map ) )
91+
$self->_croak( "Callback $event is not supported. Valid callbacks are "
92+
. join( ', ', sort keys %ok_map ) )
9693
unless exists $ok_map{$event};
9794

9895
push @{ $self->{code_for}{$event} }, $callback;

lib/TAP/Formatter/Console.pm

+12-13
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ BEGIN {
2222
stdout => sub {
2323
my ( $self, $ref ) = @_;
2424
$self->_croak("option 'stdout' needs a filehandle")
25-
unless ( ref $ref || '' ) eq 'GLOB' or
26-
eval { $ref->can('print') };
25+
unless ( ref $ref || '' ) eq 'GLOB'
26+
or eval { $ref->can('print') };
2727
return $ref;
2828
},
2929
);
@@ -78,13 +78,12 @@ sub _initialize {
7878
# Handle legacy verbose, quiet, really_quiet flags
7979
my %verb_map = ( verbose => 1, quiet => -1, really_quiet => -2, );
8080

81-
my @verb_adj
82-
= grep {$_} map { delete $arg_for{$_} ? $verb_map{$_} : 0 }
81+
my @verb_adj = grep {$_} map { delete $arg_for{$_} ? $verb_map{$_} : 0 }
8382
keys %verb_map;
8483

8584
$self->_croak(
86-
'Only one of verbose, quiet or really_quiet should be specified'
87-
) if @verb_adj > 1;
85+
'Only one of verbose, quiet or really_quiet should be specified' )
86+
if @verb_adj > 1;
8887

8988
$self->verbosity( shift @verb_adj || 0 );
9089

@@ -308,22 +307,22 @@ sub summary {
308307
" TODO passed: ", $test, $parser
309308
);
310309

311-
# ~TODO this cannot be the default
312-
#$self->_output_summary_failure( 'skipped', " Tests skipped: " );
310+
# ~TODO this cannot be the default
311+
#$self->_output_summary_failure( 'skipped', " Tests skipped: " );
313312

314313
if ( my $exit = $parser->exit ) {
315314
$self->_summary_test_header( $test, $parser );
316-
$self->_failure_output(
317-
" Non-zero exit status: $exit\n");
315+
$self->_failure_output(" Non-zero exit status: $exit\n");
318316
}
319317

320318
if ( my @errors = $parser->parse_errors ) {
321319
my $explain;
322320
if ( @errors > $MAX_ERRORS && !$self->errors ) {
323321
$explain
324-
= "Displayed the first $MAX_ERRORS of " .
325-
scalar(@errors) . " TAP syntax errors.\n" .
326-
"Re-run prove with the -p option to see them all.\n";
322+
= "Displayed the first $MAX_ERRORS of "
323+
. scalar(@errors)
324+
. " TAP syntax errors.\n"
325+
. "Re-run prove with the -p option to see them all.\n";
327326
splice @errors, $MAX_ERRORS;
328327
}
329328
$self->_summary_test_header( $test, $parser );

lib/TAP/Formatter/Console/ParallelSession.pm

+14-6
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,9 @@ sub _clear_line {
108108
sub _output_ruler {
109109
my $self = shift;
110110
my $formatter = $self->formatter;
111-
my $context = $shared{$formatter};
111+
return if $formatter->really_quiet;
112+
113+
my $context = $shared{$formatter};
112114

113115
# Too much boilerplate!
114116
my $ruler = sprintf( "===( %7d )", $context->{tests} );
@@ -136,8 +138,9 @@ sub result {
136138

137139
if ( $result->is_bailout ) {
138140
$formatter->_failure_output(
139-
"Bailout called. Further testing stopped: " .
140-
$result->explanation . "\n" );
141+
"Bailout called. Further testing stopped: "
142+
. $result->explanation
143+
. "\n" );
141144
}
142145

143146
# $self->_plan( '/' . ( $planned || 0 ) . ' ' ) unless $self->_plan;
@@ -200,10 +203,15 @@ sub close_test {
200203
my $formatter = $self->formatter;
201204
my $context = $shared{$formatter};
202205

203-
$self->_clear_line;
206+
unless ( $formatter->really_quiet ) {
207+
$self->_clear_line;
204208

205-
# my $output = $self->_output_method;
206-
$formatter->_output( $formatter->_format_name( $self->name ), ' ' );
209+
# my $output = $self->_output_method;
210+
$formatter->_output(
211+
$formatter->_format_name( $self->name ),
212+
' '
213+
);
214+
}
207215

208216
if ( $parser->has_problems ) {
209217
$self->_output_test_failure($parser);

0 commit comments

Comments
 (0)