← Back to team overview

yade-dev team mailing list archive

Re: Removing trailing white space, yay or nay?


I remove trailing whitespace at the end of the line, provided that I am changing this line for some *other* purpose.

I prefer to avoid changing lines only for the sake of formatting, because that will eventually cause unwanted and unnecessary merge conflicts later.

Also I tend to add a newline at the end of file if such newline is missing. That’s only because ’git diff’ shows warnings about the lack of these. In fact ‘git diff’ also complains about trailing whitespaces by printing them in red. It makes it simpler to remove them ;)

-- Janek Kozicki
On 17 Oct 2019, 11:05 +0200, Robert Caulk <rob.caulk@xxxxxxxxx>, wrote:
> Hey yade devs,
> Lately I’ve been letting my editor automatically remove trailing white space in the files I’m working on. The benefit to doing this can be disputed, but it seems most people agree that trailing white space is undesirable because it can create unwanted commit noise and interfere with other developers quick keys [1]. A Couple other benign reasons highlighted in that thread:
> • It takes more storage space than necessary
> • The parser will have to skip an extra character for no good reason when compiling
> • Some editors might add an extra blank line when WordWrap is on and the trailing space doesn't fit
> • It feels like the cursor is hanging in thin air at the end of a line, every step to the right may cause it to either drop or to hover further to an unknown extent, it just feels unsteady (like those invisible or disappearing blocks that Super Mario used to jump on).
> But clearly the first commit on a file where existing trailing white space is removed is also going to look excessive and polluted [2]...
> I will follow the majority opinion in our community on keeping or progressively doing away with trailing white space. Thoughts?
> Cheers,
> Robert
> [1]https://softwareengineering.stackexchange.com/questions/121555/why-is-trailing-whitespace-a-big-deal
> [2]https://gitlab.com/yade-dev/trunk/merge_requests/296/diffs?diff_id=59111225&start_sha=bfa40d9617c0c3f03c5d8eaddfd52d4c075f2781#65534ad2321a960558c286a3a64b1c38fb17f52c
> _______________________________________________
> Mailing list: https://launchpad.net/~yade-dev
> Post to : yade-dev@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~yade-dev
> More help : https://help.launchpad.net/ListHelp

Follow ups