forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eirik Bjørsnøs <bjors...@stud.ntnu.no>
Subject Re: Please not hard-coded tabs in SVN
Date Sun, 15 Aug 2004 14:57:20 GMT

> Not to pick on you Thorsten, but your commits have been
> adding hard-coded tab markers into otherwise tab-free files.

David,

Why not set up a pre-commit check script in SVN that scans all commited 
files for tabs and abort the commit if it finds any?

We've been doing this in a project I'm in (using CVS),  with great 
success.  I'm sure it's possible to implement something similar using 
Subversion.

Here's the perl script we're using:

# Scan all files
foreach $file (@ARGV) {
     if ($file =~ /.java/) {
         open(FILEHANDLE, $file);
         $line = 0;
         while (<FILEHANDLE>) {
             $line++;
             if (/\t/) {
                 print("Tab detected on line $line in file $file:\n$_");
                 print("Please remove it and try again\n");
                 exit(1);
             }
         }
         close(FILEHANDLE);
     }
}

Checking should be disabled for binary files, though.

Eirik.
-- 
Eirik Bjørsnøs

Mime
View raw message