Re: Tabs in source code (not critical)
Date: 14 Jan 2003 11:41:59 -0500
Here is how we solve this problem:
do cvs co CVSROOT
then you add file checkTabs:
# checkTabs checks source code for explicit TABS
# checks only files with the following extensions: .c, .cxx, .txx,
# exits with 0, if all commited files pass the test.
# exits with 1, if any one of the tests fails
# checkTabs can be run as a cvs commitinfo command.
# The following commitinfo line (without the #) will run the script
# ALL $CVSROOT/CVSROOT/checkTabs
# skip the first arg, the directory
foreach file ( $argv[2-] )
# select files with extentions .txx, .cxx, .h, .html, .htm
set match=`echo $file | egrep
if ( $match == "" ) continue;
set count=`grep -n " " /dev/null $file|wc -c`
set results=`expr $count \| 0`
if ( "$results" != "0" ) then
grep -n " " /dev/null $file
echo "$file has explicit TABSs."
echo "They must be converted to SPACES(2 per TAB) before you can
(You could code it in korn shell or bash or whatever).
Then you add into file checkoutlist:
checkTabs cannot check out checkTabs
That is it.
We have this for tabs, windows new lines (^M), enter on last line, and
check for conflicts in the file. So people cannot commit these kind of
On Tue, 2003-01-14 at 11:30, Daniel Stenberg wrote:
> Right, I've had that in my .emacs the last ten years or so.
> They do sneak in every once in a while anyway though, when I'm sloppy in my
> reviewing of/correcting other people's fixes...
This SF.NET email is sponsored by: FREE SSL Guide from Thawte
are you planning your Web Server Security? Click here to get a FREE
Thawte SSL guide and find the answers to all your SSL security issues.
Received on 2003-01-14