# New Ticket Created by "Paul Cochrane"
# Please include the string: [perl #40592]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=40592 >
Hi,
This patch: replaces the pattern match operators used so that vim can
syntax highlight the file properly; adds more languages to the
language list so that the script can find more files to check; and
fixes a minor typo in one comment.
Comments welcome,
Regards,
Paul
files affected:
t/codingstd/linelength.t
Index: t/codingstd/linelength.t
===================================================================
--- t/codingstd/linelength.t (revision 15007)
+++ t/codingstd/linelength.t (working copy)
@@ -21,20 +21,27 @@
our $columns = 100;
-use lib qw! . lib ../lib ../../lib !;
+use lib qw( . lib ../lib ../../lib );
use Test::More;
use Parrot::Config;
-use ExtUtils::Manifest qw!maniread!;
+use ExtUtils::Manifest qw( maniread );
-use vars [EMAIL PROTECTED];
+use vars qw( @files );
diag "finding source files, this may take a while.";
our %check_language = map { $_ => 1; } qw{
+ APL
+ WMLScript
+ amber
+ cardinal
+ dotnet
lua
+ perl6
+ pugs
+ python
tcl
- WMLScript
};
# XXX this should really be using src_dir instead of build_dir but it
@@ -45,8 +52,8 @@
# Read some extra exceptions
while (<DATA>) {
- next if m!^#!;
- next if m!^\s*$!;
+ next if m{^#};
+ next if m{^\s*$};
chomp;
$manifest_gen->{$_}++;
}
@@ -62,15 +69,15 @@
next if exists( $manifest_gen->{$file} );
# I could make this other way, but this way is more flexible
- next if ( $ffile =~ m!^$build_dir/languages/([^/]+)/!
+ next if ( $ffile =~ m{^$build_dir/languages/([^/]+)/}
&& !$check_language{$1} );
- push @files, $ffile if $file =~ m!\.c$!;
- push @files, $ffile if $file =~ m!\.pmc$!;
- push @files, $ffile if $file =~ m!\.ops$!;
- push @files, $ffile if $file =~ m!\.pod$!;
+ push @files, $ffile if $file =~ m{\.c$};
+ push @files, $ffile if $file =~ m{\.pmc$};
+ push @files, $ffile if $file =~ m{\.ops$};
+ push @files, $ffile if $file =~ m{\.pod$};
- # push @files, $ffile if $file =~ m!\.pl$!;
+ # push @files, $ffile if $file =~ m{\.pl$};
}
plan tests => scalar @files;
@@ -81,7 +88,7 @@
my $l; # will hold the first line to be corrected
my $g = $f; # will hold the file to be corrected with relative path;
- $g =~ s!^$build_dir/!!;
+ $g =~ s{^$build_dir/}{};
my $ok = 1;
@@ -122,7 +129,7 @@
tools/build/nativecall.pl
tools/dev/lib_deps.pl
tools/dev/parrot_coverage.pl
-# these ones includes a big URL
+# these ones include a big URL
cage/todo.pod
docs/gettingstarted.pod
docs/glossary.pod