Cosium / git-code-format-maven-plugin

A maven plugin that automatically deploys code formatters as pre-commit git hook

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Plugin's format style is different then IntelliJ formatting that uses intellij-java-google-style.xml

Soneray opened this issue · comments

What steps will reproduce the problem?
Steps to reproduce the behavior:

  1. Reformat the source code using Intellij that configured with intellij-java-google-style.xml
  2. Reformat the source code again with git-code-format plugin using the command "mvn git-code-format:format-code -Dgcf.globPattern=**/*" or with pre-commit hook.
  3. Compare both.

What is the expected output?
Since they both follow Google code style, they should both produce the same style.

What happens instead?
Reformatted codes have different styles. For example;

IntelliJ style
`/**

  • Example Javadoc.
    */
    public class EventHelper {

/**

  • Example Constructor.
    */
    private EventHelper() {
    }`

git-code-format style
`/** Example Javadoc. */
public class EventHelper {

/** Example Constructor. */
private EventHelper() {}`

Environment:

  • OS: MacOS 10.15.6
  • Git version: 2.23.0
  • git-code-format-maven-plugin version: 2.6
  • Maven version: 3.6.3

Additional context
I also tried Google Intellij plugin to reformat the code and got same results. This is puzzling for me because this plugin and Google IntelliJ plugin both use google-java-format.jar and produces different results. I also reproduced this issue with another popular maven Google code style formatting plugin.

Duplicate of #18