Trailing whitespaces throughout the tree

Hey guys,

I was wondering what’s the official opinion on trailing whitespace.
I am aware that this is not a pressing issue, however personally I think
they’re nasty.

After finding an new vim plugin ([1]) I noticed we have quite some
around the tree. I removed them with a simple:

$ sed -i -e ‘s/\s+$//g’ $(find . -type f | grep -v ‘.git’)

As anyway we’re using git I think it can also be configured to remove
them via a pre-commit or commit hook.

Attached you’ll find a huge patch (as in changed lines, not in impact
:wink: ) touching a lot of different files.
Although I ran the QA to see if something breaks there still might be
some issues. Git gurus out there, is there a better way to do it?

Cheers,

Moritz

[1] bad-whitespace - Highlights whitespace at the end of lines, only in modifiable buffers : vim online

$ sed -i -e ‘s/\s+$//g’ $(find . -type f | grep -v ‘.git’)

Ehrm … yeah … I was kinda quick with this one … of course patching
png images and other binary files is not a good idea …

Should be something like:

$ sed -i -e ‘s/\s+$//g’ $(find . -type f | grep -v ‘.git’ | grep -v
‘png’ | grep -v ‘eps’)

instead.

Sorry for the double post.

Cheers,

Moritz

On Fri, Apr 13, 2012 at 8:41 AM, Moritz Fischer
[email protected] wrote:

instead.

Sorry for the double post.

Cheers,

Moritz

Moritz,

Thanks, I’m going to apply this and stash a script of it in dtools/bin
for future use.

Tom