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 ?

On Tue, May 14, 2024 at 6:32 AM Matthias Sohn via jgit-dev <jgit-dev@xxxxxxxxxxx> wrote:
I am tired of discussing source code formatting and some JGit contributors don't use Eclipse IDE hence they have a hard time getting formatting right since we currently use the Eclipse auto-formatter.

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.


We've had very good results with automated code formatting in the Jenkins project.  We use the Apache Maven `spotless`  plugin with `palantirJavaFormat` (derived from google code format).

The reasoning for the change to automated formatting and the details of that change are included in

Mark Waite

Back to the top