inc/CommitCheck/BlankLines.php
authorAlan Knowles <alan@akbkhome.com>
Thu, 27 Jan 2011 06:51:43 +0000 (14:51 +0800)
committerAlan Knowles <alan@akbkhome.com>
Thu, 27 Jan 2011 06:51:43 +0000 (14:51 +0800)
inc/CommitCheck/BlankLines.php

index 3344cd4..0baff94 100644 (file)
@@ -38,31 +38,5 @@ class MTrackCommitCheck_BlankLines implements IMTrackCommitListener
     function postCommit($msg, $files, $actions) {
         return true;
     }
-    function checkBlanks($filename, $fp)
-    {
-        $pipes = null;
-        $contents = stream_get_contents($fp);
-        $lines = explode("\n",$contents);
-        $seq = 0;
-        $total = 0;
-        foreach($lines as $l) {
-            if (strlen(trim($l))) {
-                $seq =0;
-                continue;
-            }
-            // got blannk line
-            $seq++;
-            $total++;
-            if ($seq > 3) {
-                return "Remove all the extra blank lines from $filename before committing";
-            }
-        }
-        
-        if (($total / count($lines)) > 0.2) {
-            return "More than 20% of $filename is blank lines - tidy up the file before committing";
-        }
-         
-        
-        return true;
-    }
+    
 }
\ No newline at end of file