From c916b5ffa3c816ada8ce112fcf466c3d8d986e76 Mon Sep 17 00:00:00 2001 From: Greg Sabino Mullane Date: Wed, 28 Sep 2016 14:20:47 -0400 Subject: [PATCH] Remove some tabs --- t/00_release.t | 70 +++++++++++++++++++++++------------------------ t/99_perlcritic.t | 22 +++++++-------- t/99_spellcheck.t | 14 +++++----- 3 files changed, 53 insertions(+), 53 deletions(-) diff --git a/t/00_release.t b/t/00_release.t index 36604b700..efac6b4fb 100644 --- a/t/00_release.t +++ b/t/00_release.t @@ -20,8 +20,8 @@ my $file = 'MANIFEST'; my @mfiles; open my $mfh, '<', $file or die qq{Could not open "$file": $!\n}; while (<$mfh>) { - next if /^#/; - push @mfiles => $1 if /(\S.+)/o; + next if /^#/; + push @mfiles => $1 if /(\S.+)/o; } close $mfh or warn qq{Could not close "$file": $!\n}; @@ -108,43 +108,43 @@ else { ## Make sure all files in the MANIFEST are "clean": no tabs, no unusual characters for my $mfile (@mfiles) { - file_is_clean($mfile); + file_is_clean($mfile); } sub file_is_clean { - my $file = shift or die; ## no critic (ProhibitReusedNames) - - if (!open $fh, '<', $file) { - fail qq{Could not open "$file": $!\n}; - return; - } - $good = 1; - my $inside_copy = 0; - while (<$fh>) { - if (/^COPY .+ FROM stdin/i) { - $inside_copy = 1; - } - if (/^\\./ and $inside_copy) { - $inside_copy = 0; - } - if (/\t/ and $file ne 'Makefile.PL' and $file !~ /\.html$/ and ! $inside_copy) { - diag "Found a tab at line $. of $file\n"; - $good = 0; - } - if (! /^[\S ]*/) { - diag "Invalid character at line $. of $file: $_\n"; - $good = 0; die; - } - } - close $fh or warn qq{Could not close "$file": $!\n}; - - if ($good) { - pass "The $file file has no tabs or unusual characters"; - } - else { - fail "The $file file did not pass inspection!"; - } + my $file = shift or die; ## no critic (ProhibitReusedNames) + + if (!open $fh, '<', $file) { + fail qq{Could not open "$file": $!\n}; + return; + } + $good = 1; + my $inside_copy = 0; + while (<$fh>) { + if (/^COPY .+ FROM stdin/i) { + $inside_copy = 1; + } + if (/^\\./ and $inside_copy) { + $inside_copy = 0; + } + if (/\t/ and $file ne 'Makefile.PL' and $file !~ /\.html$/ and ! $inside_copy) { + diag "Found a tab at line $. of $file\n"; + $good = 0; + } + if (! /^[\S ]*/) { + diag "Invalid character at line $. of $file: $_\n"; + $good = 0; die; + } + } + close $fh or warn qq{Could not close "$file": $!\n}; + + if ($good) { + pass "The $file file has no tabs or unusual characters"; + } + else { + fail "The $file file did not pass inspection!"; + } } diff --git a/t/99_perlcritic.t b/t/99_perlcritic.t index 4a1e449e8..5bed531dd 100644 --- a/t/99_perlcritic.t +++ b/t/99_perlcritic.t @@ -41,17 +41,17 @@ for my $filename (qw{Makefile.PL check_postgres.pl t/CP_Testing.pm}) { -e $filename or die qq{Could not find "$filename"!}; open my $oldstderr, '>&', \*STDERR or die 'Could not dupe STDERR'; close STDERR or die qq{Could not close STDERR: $!}; - my @vio; - my $ranok = 0; - eval { - @vio = $critic->critique($filename); - $ranok = 1; - }; - if (! $ranok) { - pass "Perl::Critic failed for file $filename. Error was: $@\n"; - $@ = undef; - next; - } + my @vio; + my $ranok = 0; + eval { + @vio = $critic->critique($filename); + $ranok = 1; + }; + if (! $ranok) { + pass "Perl::Critic failed for file $filename. Error was: $@\n"; + $@ = undef; + next; + } open STDERR, '>&', $oldstderr or die 'Could not recreate STDERR'; ## no critic close $oldstderr or die qq{Could not close STDERR copy: $!}; my $vios = 0; diff --git a/t/99_spellcheck.t b/t/99_spellcheck.t index 37a6f8011..070b28d08 100644 --- a/t/99_spellcheck.t +++ b/t/99_spellcheck.t @@ -79,19 +79,19 @@ SKIP: { skip 'Need Pod::Text to re-test the spelling of embedded POD', 1; } - my $parser = Pod::Text->new (quotes => 'none'); + my $parser = Pod::Text->new (quotes => 'none'); for my $file (qw{check_postgres.pl}) { if (! -e $file) { fail(qq{Could not find the file "$file"!}); } - my $string; - my $tmpfile = "$file.tmp"; + my $string; + my $tmpfile = "$file.tmp"; $parser->parse_from_file($file, $tmpfile); - next if ! open my $fh, '<', $tmpfile; - { local $/; $string = <$fh>; } - close $fh or warn "Could not close $tmpfile\n"; - unlink $tmpfile; + next if ! open my $fh, '<', $tmpfile; + { local $/; $string = <$fh>; } + close $fh or warn "Could not close $tmpfile\n"; + unlink $tmpfile; spellcheck("POD from $file" => $string, $file); } } -- 2.30.2