ompi icon indicating copy to clipboard operation
ompi copied to clipboard

Remove Trailing Whitespace

Open a-szegel opened this issue 3 years ago • 4 comments

Removes trailing whitespace in one spot to allow IDE's to enable the auto-remove trailing whitespace setting without adding a lot of extra diffs to commits. When you make a 1 line change in a file and have 100 lines of trailing whitespace changes in the diff, it is time consuming to review.

Signed-off-by: Seth Zegelstein [email protected]

a-szegel avatar May 16 '22 22:05 a-szegel

This is the same as the infamous clang-format patch: it pollutes the git history and makes git blame virtually useless. The actual benefit of whitespace-only changes for the community is asymptotically approaching zero. IMHO, you should fix your editor to remove whitespaces only on lines or files you edited or at least provide a substantive change that justifies changing the files.

devreal avatar May 17 '22 02:05 devreal

The trim trailing whitespace on only lines edited is a good idea, but it is still a feature idea with VSCode: https://github.com/microsoft/vscode/issues/1315 (for 5 years now). To fix git blame, you can do: git blame --ignore-rev <this commit> (and have the blame that you were looking for). I think this change will make cleaner PRs in the future, which is worth the price of an extra argument to git blame, and 1 additional commit in the history.

a-szegel avatar May 17 '22 16:05 a-szegel

@a-szegel I realize that the concept of a whitespace-fixing-only set of commits is a bit controversial, but would it be possible to separate out the whitespace fixes to files that end in .rst? Those are just docs files, and it looks like there's only 1 line in each file that it's fixing (all the man page *.rst files were automatically generated, and perhaps we had a bug in the python that generated them that included a rogue line that contained just a space).

jsquyres avatar Jul 24 '22 20:07 jsquyres

Since this PR became controversial, I extracted the part of this commit that fixes the whitespace in the RST man pages and put that in https://github.com/open-mpi/ompi/pull/10652.

jsquyres avatar Aug 12 '22 00:08 jsquyres

Since it looks like we're not moving forward with this change, I'm closing this PR. Please re-open if necessary.

wckzhang avatar Mar 02 '23 00:03 wckzhang