-
Notifications
You must be signed in to change notification settings - Fork 461
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ignore line-wrapping-only changes #817
Comments
It's known that the formatting of google-java-format differs to IntelliJ's (and thus Android Studio's). It's in fact a consequence of the google-java-format team's goal to make a formatter that was more flexible for them than IntelliJ's formatter was when google-java-format first came into being.
|
Never mind, I was too quick re. the "won't fix" comment! Apologies! |
I think people have managed to "hack" the internals of google-java-format in the past to allow the line wrapping length to be adjusted. See talios/googleformatter-maven-plugin for a Maven plugin example of how this might be done. But as always, this is prone to breakage when a new version of google-java-format is released. |
I agree with everything @jbduncan said, and I think this is mostly a wontfix. But! It is somewhat frequent for users to complain about line-wrapping behavior. One solution might be a
This is tricky to build, and it's not going to make my todo list. But if someone wants to do it, these parts are already available:
|
While using spotless for Android, we run in to an issue where Android Studio line wrapping is overridden with spotless. There is no API exposed for changing this so that we can synchronize Android studio line wrapping with Spotless line wrapping.
The formatting of java code is being set to
googleJavaFormat(1.8).aosp()
and having a customizable line wrapping would help with unwanted git changes issues.java { target '**/*.java' targetExclude '**/generated/**' googleJavaFormat('1.8').aosp() removeUnusedImports() trimTrailingWhitespace() indentWithSpaces() endWithNewline() }
The text was updated successfully, but these errors were encountered: