Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[egit-dev] Whitespace conventions

Can we record the decisions on whitespace conventions somewhere in the contributor guide? Gerrit seems to be enforcing a de-facto no-trailing- whitespace rule, even though that's not mentioned anywhere.

If we're going to enforce a no-trailing-whitespace rule, we should set up the project's .settings to allow whitespace to be removed automatically, instead of having to go through a submit-reject-revise path each time. Hitherto, trailing whitespace never appears to have caused problems with other Eclipse projects, and therefore it would make sense to document the more strict requirements; but at the same time, we shouldn't be aiming to make life more difficult for those wishing to contribute.

There is an argument that says 'we should leave things as is' but it's not that big of a problem at the moment - there's 60 source-code lines in the EGit codebase with trailing whitespace (of which only 2 are source code lines, and 1 is a documentation line; the rest are either blank lines or empty JavaDoc lines) - though there are a few trailing whitespace lines in the license.html, plugin.xml, EGIT_INSTALL and README files, none of which the JDT formatting operations will touch anyway. I really don't think any impact to losing file history over mostly blank lines is going to affect anyone negatively. As for JGit, there's only 8 source code lines with real code on them, and a couple of ; the remainder are empty lines (or empty JavaDoc lines).

Therefore, I propose that we enforce no-trailing-whitespace from within the JDT to make it easier to contribute code to EGit/JGit. Separately, we can then decide whether to clean up existing source files (e.g. ResetOperation, RepositoryAction) with known trailing whitespace by coming across them at a later stage, or whether we do a big-bang update.

I've pushed a change to gerrit for EGit ( and JGit ( to remove trailing whitespace that currently exists. As can be seen by the diffs, almost the entire collection is empty line related. Whether this is adopted or not is less important than whether we configure Eclipse correctly to get rid of whitespace to make the effort involved in contributing to EGit much easier than it is at the moment.


Back to the top