Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jgit-dev] auto-formatting source code ?

With spotless-maven-plugin, you can

- use google-java-format or eclipse formatter, maintainer's choice
- optionally use "ratchetFrom origin/main" so that the autoformatting only happens on changed files, to avoid a giant "format everything" commit

I actually started Spotless many years ago because of a frustrating experience getting a PR merged into JGit, lol. Just a quick plug since I was on the mailing list, I'm terrible with maven and I don't know much about JGit's build.

Ned Twigg
Lead Software Engineer, DiffPlug LLC
540-336-8043 (cell)
447 Sutter St Ste 405, San Francisco, CA 94108

On Tue, May 14, 2024 at 10:51 AM Thomas Wolf via jgit-dev <jgit-dev@xxxxxxxxxxx> wrote:
On 14.05.24 14:31 , Matthias Sohn via jgit-dev wrote:
> Hence I propose we adopt the approach the Gerrit project is using and
> switch from Eclipse auto-formatter to google-java-format [1] and add a
> Gerrit submit rule and a label "CodeStyle" which the CI can vote on to
> block changes which weren't properly auto-formatted using
> google-java-format.
> WDYT ?
> [1]
> <>

Don't care much *if* the google-java-format works seamlessly in
Eclipse. Switching away from the Eclipse formatter to something else
simply inverts the burden: currently non-Eclipse users would have to
configure their IDEs to use the Eclipse formatter (which _is_ possible
at least in IntelliJ), in the future, Eclipse users would have to do

IMO, much more important than formatting would be to run the Eclipse
PDE API checks during the normal build at least on Jenkins, and fail
the build if there are any problems. (Wrong @since, non-API types
used in API methods, breaking API, etc.)



jgit-dev mailing list
To unsubscribe from this list, visit

Back to the top