← Back to team overview

mvhub-dev team mailing list archive

[Branch ~mvhub-commit/mvhub/trunk] Rev 464: merged perltidy_doesnt_check

 

Merge authors:
  Dan MacNeil (omacneil)
  Sri Redy <reddy22222@xxxxxxxxxx>
Related merge proposals:
  https://code.launchpad.net/~reddy22222/mvhub/perltidy_doesnt_check/+merge/31327
  proposed by: Srihari Reddy (reddy22222)
------------------------------------------------------------
revno: 464 [merge]
committer: Dan MacNeil <dan@xxxxxxxxxxxx>
branch nick: trunk
timestamp: Thu 2010-08-05 16:59:55 -0400
message:
   merged perltidy_doesnt_check
modified:
  app-mvhub/t/perltidy.t


--
lp:mvhub
https://code.launchpad.net/~mvhub-commit/mvhub/trunk

Your team MVHub Developers is subscribed to branch lp:mvhub.
To unsubscribe from this branch go to https://code.launchpad.net/~mvhub-commit/mvhub/trunk/+edit-subscription
=== modified file 'app-mvhub/t/perltidy.t'
--- app-mvhub/t/perltidy.t	2010-07-05 18:12:08 +0000
+++ app-mvhub/t/perltidy.t	2010-07-29 22:19:30 +0000
@@ -6,6 +6,7 @@
 use Carp;
 use Test::More;
 use File::Temp;
+use Params::Validate;
 
 use TestHelper;
 
@@ -65,16 +66,27 @@
 sub _get_uncommitted_perl_files {
 
     my @perl_files = `bzr status`;
+    my @all_files = get_files_from( '.',q{'*'} );
     chomp @perl_files;
-    @perl_files = map { s# +##; $_; } @perl_files;
-    @perl_files = grep { m/(pl|pm|t)$/; } @perl_files;
+    # @perl_files = map { s# +##; $_; } @perl_files;
+    foreach my $file (@all_files)
+    {
+        my $result = `/usr/bin/file -b $file`;
+	push @perl_files, $file if $result=~m/perl/i;
+    }
 
     return @perl_files;
 }
 
 sub _get_all_perl_files {
+    my @perl_files;
+    my @all_files = get_files_from( '.',q{'*'} );
+    foreach my $file (@all_files)
+    {
+        my $result = `/usr/bin/file -b $file`;
+	push @perl_files, $file if $result=~m/perl/i;
+    }
 
-    my @perl_files = get_files_from( '.', qw/*.pl *.pm *.t / );
     @perl_files = map { s#^.*lib-mvhub/t/\.\.#lib-mvhub#;  $_; } @perl_files;
     @perl_files = map { s#^.*app-mvhub/t/\.\.#app-mvhub/#; $_; } @perl_files;
     @perl_files = map { s#^\./##;                          $_; } @perl_files;
@@ -82,6 +94,12 @@
     return @perl_files;
 }
 
+sub _is_perl {
+  Validate::Params::validate_pos(@_,1);
+  my $file=shift;
+  my $result=`file $file`
+}
+
 sub _build_fix_msg {
     my $perltidyrc = shift or croak 'missing pararm: $perltidyrc';
     my @files      = @_    or die 'missing parameter: @files';