[rspec-users] Coding standards and whitespace

Wincent Colaiuta win at wincent.com
Tue Jul 31 17:18:51 EDT 2007

El 31/7/2007, a las 22:48, aslak hellesoy escribió:

> The root Rakefile has a task :fix_cr_lf which I ran a while ago to fix
> newlines in .rb files. Perhaps it can be improved to scan over more
> files, and replace \t with '  ' too?
> I'll see what I can do.
> Thoughts?

Sounds like a good idea. I would suggest that \t should be replaced  
with '  ' only if it is in the leading whitespace for a line; if it  
is elsewhere in the line it is probably being (mis)used for alignment  
and it's probably better to just print a warning showing the filename  
and then you'd have to visually inspect it as a straight  
transliteration might not be right (it might be equivalent to one  
space, not two).

I think it's also worth looking for trailing whitespace as it is  
almost always an mistake which apports neither semantic meaning nor  
visual enhancement.


More information about the rspec-users mailing list