From 8ec8da0491ad89604700b3e29a227966f6d84ba1 Mon Sep 17 00:00:00 2001 From: Perl Tidy Date: Wed, 5 Dec 2018 15:38:52 -0500 Subject: no bug - reformat all the code using the new perltidy rules --- t/009bugwords.t | 74 ++++++++++++++++++++++++++++++--------------------------- 1 file changed, 39 insertions(+), 35 deletions(-) (limited to 't/009bugwords.t') diff --git a/t/009bugwords.t b/t/009bugwords.t index ebfd99507..48a601513 100644 --- a/t/009bugwords.t +++ b/t/009bugwords.t @@ -32,48 +32,52 @@ use Test::More tests => ($Support::Templates::num_actual_files); # Find all the templates my @testitems; for my $path (@Support::Templates::include_paths) { - push(@testitems, map(File::Spec->catfile($path, $_), - Support::Templates::find_actual_files($path))); + push( + @testitems, + map(File::Spec->catfile($path, $_), + Support::Templates::find_actual_files($path)) + ); } foreach my $file (@testitems) { - my @errors; - - # Read the entire file into a string - local $/; - open (FILE, "<$file") || die "Can't open $file: $!\n"; - my $slurp = ; - close (FILE); - - # /g means we execute this loop for every match - # /s means we ignore linefeeds in the regexp matches - # This extracts everything which is _not_ a directive. - while ($slurp =~ /%\](.*?)(\[%|$)/gs) { - my $text = $1; - - my @lineno = ($` =~ m/\n/gs); - my $lineno = scalar(@lineno) + 1; - - # "a bug", "bug", "bugs" - if (grep /(a?[\s>]bugs?[\s.:;,<])/i, $text) { - # Exclude variable assignment. - unless (grep /bugs =/, $text) { - push(@errors, [$lineno, $text]); - next; - } - } + my @errors; + + # Read the entire file into a string + local $/; + open(FILE, "<$file") || die "Can't open $file: $!\n"; + my $slurp = ; + close(FILE); + + # /g means we execute this loop for every match + # /s means we ignore linefeeds in the regexp matches + # This extracts everything which is _not_ a directive. + while ($slurp =~ /%\](.*?)(\[%|$)/gs) { + my $text = $1; + + my @lineno = ($` =~ m/\n/gs); + my $lineno = scalar(@lineno) + 1; + + # "a bug", "bug", "bugs" + if (grep /(a?[\s>]bugs?[\s.:;,<])/i, $text) { + + # Exclude variable assignment. + unless (grep /bugs =/, $text) { + push(@errors, [$lineno, $text]); + next; + } } + } - if (scalar(@errors)) { - ok(0, "$file contains invalid bare words (e.g. 'bug') --WARNING"); + if (scalar(@errors)) { + ok(0, "$file contains invalid bare words (e.g. 'bug') --WARNING"); - foreach my $error (@errors) { - print "$error->[0]: $error->[1]\n"; - } - } - else { - ok(1, "$file has no invalid barewords"); + foreach my $error (@errors) { + print "$error->[0]: $error->[1]\n"; } + } + else { + ok(1, "$file has no invalid barewords"); + } } exit 0; -- cgit v1.2.3-24-g4f1b