[Geany-devel] Remove extra whitespace at end of lines in all source files?

Matthew Brush mbrush at xxxxx
Wed Oct 12 22:50:22 UTC 2011


On 11-10-12 07:14 AM, Nick Treleaven wrote:
> On 12/10/2011 06:00, Matthew Brush wrote:
>> Remove extra whitespace at end of lines in all source files.
>>
>> * Processed with rstrip-whitespace.py script added to scripts/ directory.
>> * Script run on all .c and .h files in src/ and plugins/ directories.
>> * Also remove more than one newline at the end of files.
>
> We've mostly done this before, but I'm not sure this is a good idea. It
> means more maintenance burden on receiving code. What's so bad about
> trailing whitespace?

The main reasons are to avoid noise in patches, prevent patch corruption 
when sent over email, and IMO it's just good practice (ie. what people 
contributing code would expect).  If we don't care about this, then why 
care about spaces vs. tabs, spaces before function parameter braces, 
indentation, and so on?

Also, I'm not suggesting that we reject code solely because of trailing 
whitespace, just that it become something the developers do; I would 
guess that the vast majority of what I removed in that commit was caused 
by Geany developers themselves.

It takes two seconds to turn the stripping feature on in Geany or Git 
and it automatically handles the "bug" in Geany's auto-indent where it 
adds the indentation when you press enter but doesn't remove it when you 
leave the line blank.  This is where the bulk of the trailing whitespace 
came from.  As of for the extra newlines at the end of files, I think 
those are caused by a "bug" in one of the processing scripts used on 
Geany's source code (fix-alignment.pl:91 maybe).

If you really feel strongly against this, I honestly don't mind if you 
revert the commit and we can just forget about it altogeher.  FWIW, I 
did check with Colomban about this, confirming that there shouldn't be 
trailing whitespace and that it was ok to commit this, before doing so.

Sorry for such a long response to something so trivial :)

Cheers,
Matthew Brush



More information about the Devel mailing list