Questions tagged [google-java-format]
28 questions
8
votes
0 answers
Spotless + Java Google format vs Intellij + import file
I am trying to configure a maven spring boot application to use spotless with google java format style. I would like as well to have Intellij formatting the code as the maven plugin does.
But i am noticing that the formmat applied differ a little…

mpssantos
- 931
- 13
- 30
7
votes
0 answers
Use of checkstyle.xml in diffplug/spotless
I have a checkstyle.xml file to check for formatting violations . Is there any way to provide checkstyle.xml as a input to diffplug/spotless formatter . Java8 is being used and spotless verison is 2.11.0 . If this is possible using spotless::apply…

darth_vader
- 149
- 10
6
votes
1 answer
Maven Checkstyle plugin with google_checks and 4 space indentSize
I am finding out ways to configure google_checks to use 4 spaces in the maven Checkstyle plugin. I set the indentSize configuration parameter to 4, but it does not work. Is there a configuration options to set this? I don't want to have my own…

Nikhil
- 345
- 2
- 13
5
votes
1 answer
How can I configure Gradle google-java-format plugin to run goJF in the build step?
We wired https://github.com/sherter/google-java-format-gradle-plugin into our project per the readme.
We also wired in a pre-commit hook to run the plugin before committing, which ensures that all of the code in a changelist is formatted before…

Jim Showalter
- 550
- 3
- 8
- 20
4
votes
1 answer
How can I use the googleJavaFormat to make reflowLongStrings set to a max of 120 chars per line
I am using the Spotless plugin to format my Java code. However, when I am enabling the reflowLongStrings rule, it breaks lines to be no longer than 80 chars.
Is it possible to change it to 120?

Avraham Cohen
- 57
- 5
4
votes
2 answers
Eclipse Plugin --add-exports Java 16+
Using the google-java-format eclipse plugin works great when running Eclipse under Java 11, but when running on Java 16+, it fails with the following error:
Full error: A save participant caused problems. The save participant 'Code Clean Up' caused…

sparty02
- 566
- 1
- 6
- 13
4
votes
0 answers
Eclipse Cursor Position Stays at Line Beginning
I'm wondering if the following behavior of the Eclipse formatter is a bug or not, and if so, if there is any workaround.
After I click return and create a new line, I can see Eclipse has automatically inserted some spaces on the new line, according…

Dave L.
- 9,595
- 7
- 43
- 69
3
votes
2 answers
Maven spotless can't skip files
I'm using maven spotless plugin to format java files, but it can't skip files. I used exclude and toggle off, neither works.
com.diffplug.spotless
spotless-maven-plugin
…

chaokunyang
- 2,177
- 1
- 12
- 12
3
votes
2 answers
Google code style formats maven pom strange in Intellij
I use the Google code style in my Java projects. I installed the google-java-format plugin in IntelliJ, but the plugin does not cover all formatting rules (e.g java imports). The documentation suggests to additionally add the Google style guide as…

Henok
- 413
- 2
- 7
- 20
3
votes
1 answer
where is eclipse dropins folder
i just downloaded eclipse 2019-03 (4.11.0), and need to install google-java-format plugin, according to the instruction I need to put the google-java-format Eclipse plugin to eclipse dropins folder, i looked around there is no such a folder, by…

user468587
- 4,799
- 24
- 67
- 124
2
votes
1 answer
What is the exact Google Java Format version used by CheckStyle 9.3?
I use Checkstyle 9.3 (because I'm still using JDK 8). I'm wondering what is the exact Google Java Format version used by that Checkstyle version? I'm referring to the following…

Jonathan Poulin
- 21
- 2
2
votes
1 answer
google-java-format dependency syncing but not getting build.
I have added mavenCentral() in rootProject build script. But its giving below error while build. Any idea on this.
You probably need to add a repository containing the '[com.google.googlejavaformat:google-java-format:1.5]' artifact in the
…

Praveen
- 90,477
- 74
- 177
- 219
1
vote
0 answers
How to get similar google java formatting in intellij and with maven
I'd like to have the google java formatting in my IDE (using the google-java-format plugin for IntelliJ or something else if that's not the best way to do...) and be able to check with maven that formatting is OK (in a GitHub workflow for example).…

Jerome VDL
- 3,376
- 4
- 32
- 33
1
vote
1 answer
google-java-format IntelliJ IDEA not formatting (Java 19)
I have OpenJDK 19 installed and use the "google-java-format" plugin. I have configured IntelliJ IDEA as per instructions here. However, code formatting doesn't work.
If I uninstall the plugin, formatting works (i.e. the cmd-opt-L shortcut works).…

Moritz Petersen
- 12,902
- 3
- 38
- 45
1
vote
0 answers
Java formatting: Disable line joining?
I have the following code:
Arrays.asList(new Point2D.Double(1.00, 3.028571712152178),
new Point2D.Double(2.00, 4.5990231472038055),
new Point2D.Double(3.00, 4.816365844337747),
new Point2D.Double(4.00, 6.018445142602669),
I am using…

Tinker
- 4,165
- 6
- 33
- 72