Reputation: 95
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?
Upvotes: 5
Views: 3151
Reputation: 178
Google java format is not configurable by design (have a look at this) so there is no way for configuring a custom max line width. What you can do is to configure spotless plugin to work with a custom eclipse jdt formatter. Here you can see how this is done in the spotless documentation.
For example, for gradle you would have:
spotless {
java {
eclipse().configFile('custom-config.xml')
}
}
Instead of:
spotless {
java {
googleJavaFormat()
}
}
Upvotes: 2