Author: paultcochrane
Date: Sun Sep 30 23:31:29 2007
New Revision: 21712

Modified:
   trunk/t/codingstd/linelength.t

Log:
[codingstd] 
 - Some minor cleanups.
 - skipping web addresses as they can often be a lot longer than 100
   characters.


Modified: trunk/t/codingstd/linelength.t
==============================================================================
--- trunk/t/codingstd/linelength.t      (original)
+++ trunk/t/codingstd/linelength.t      Sun Sep 30 23:31:29 2007
@@ -16,8 +16,9 @@
 
 =head1 DESCRIPTION
 
-Tests source files for the line length limit as defined in 
F<pdd07_codingstd.pod>.
-Only files for some language implementations are checked.
+Tests source files for the line length limit as defined in
+F<pdd07_codingstd.pod>.  Only files for some language implementations are
+checked.
 
 =head1 SEE ALSO
 
@@ -38,7 +39,8 @@
 use ExtUtils::Manifest qw( maniread );
 
 # a list of languages where we want to test line length
-my %lang_is_checked = map { $_ => 1 } qw{ APL
+my %lang_is_checked = map { $_ => 1 } qw{
+    APL
     WMLScript
     amber
     cardinal
@@ -76,7 +78,7 @@
     push @lines_too_long => $lineinfo;
 }
 
-## L<PDD07/Code Formatting/"Source line width is limited to 100 characters">
+## L<PDD07/Code Formatting/"Source line length is limited to 100 characters">
 ok( [EMAIL PROTECTED], 'Line length ok' )
     or diag( "Lines longer than coding standard limit ($num_col_limit columns) 
in "
         . scalar @lines_too_long
@@ -90,6 +92,7 @@
     while ( my $line = <$fh> ) {
         chomp $line;
         $line =~ s/\t/' ' x (1 + length($`) % 8)/eg;    # expand \t
+        next if $line =~ m/https?:\/\//;  # skip long web addresses
         return sprintf '%s:%d: %d cols', $file, $., length($line)
             if length($line) > $num_col_limit;
     }

Reply via email to