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 ?

+1 to move to the google-java-format. It is much easier to configure and will remove a hurdle for new contributors.

Ivan

On Tue, May 14, 2024 at 6:44 AM Antonin Delpeuch via jgit-dev <jgit-dev@xxxxxxxxxxx> wrote:
I think it makes sense to validate the formatting in the CI, but you
don't need to switch to a different code formatting standard for that.
There is the "formatter-maven-plugin" which integrates Eclipse's
formatter in Maven. You can use it both to validate compliance with the
format and to reformat automatically.

https://github.com/revelc/formatter-maven-plugin

Best,

Antonin

On 14/05/2024 14:31, Matthias Sohn via jgit-dev 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.
>
> WDYT ?
>
> [1] https://github.com/google/google-java-format
>
> -Matthias
>
> _______________________________________________
> jgit-dev mailing list
> jgit-dev@xxxxxxxxxxx
> To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/jgit-dev
_______________________________________________
jgit-dev mailing list
jgit-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/jgit-dev

Back to the top