spotless icon indicating copy to clipboard operation
spotless copied to clipboard

Allow passing the formatJavadoc flag to Google Java Formatter

Open coyotesqrl opened this issue 4 years ago • 5 comments

Back in November, the Google Java Formatter was updated to support turning off formatting of javadocs. This is particularly useful functionality with newer javadoc trends as well as older codebases that include heterogenous license headers.

Here is the PR that added the functionality: google/google-java-format#418

coyotesqrl avatar Jun 18 '20 16:06 coyotesqrl

Happy to take a PR for this (useful guide pr: https://github.com/diffplug/spotless/pull/193).

If you'd like to gradually unify the license headers, without ever having a history-clobbering "format-the-world" moment, maybe try ratchetFrom 'origin/main'.

nedtwigg avatar Jun 18 '20 16:06 nedtwigg

Is there a workaround/hack for this? We can't adopt the Google formatter without this, as it unnecessarily changes the Javadoc in our entire codebase.

fcurts avatar Jul 17 '21 02:07 fcurts

The PR referenced above (#193) is a very similar situation. To my knowledge, no workaround besides a PR.

nedtwigg avatar Jul 17 '21 03:07 nedtwigg

Is it possible to support a generic way to pass options so that users aren't blocked every time a new option is added?

fcurts avatar Jul 20 '21 00:07 fcurts

Maybe! PR's welcome :)

nedtwigg avatar Jul 20 '21 04:07 nedtwigg

Closed by #1793.

Goooler avatar Sep 28 '23 15:09 Goooler