google / google/google-java-format
When Javadoc formatting is disabled, don't change javadoc so much
- Dominant language
- Java
- Stars
- 6.2k
- Forks
- 937
- Avg merge
- 6m
- Merged PRs (30d)
- 3
Description
Javadoc formatting regularly gives undesired results and lags behind in its support for both Javadoc (esp. `{@snippet ...}`) and HTML (e.g. elements such as ``, ``, ``, ``, ... aren't properly supported, nor is wrapping a "block" with an `` element, etc.).
With `--skip-javadoc-formatting`, the result is unusable as well, because indentation is still removed.
So because of the poor Javadoc formatting, and the inability to disable it altogether, it's impractical to format my Java code with GJF.
I propose to at least provide an option to disable Javadoc formatting altogether (i.e. not even adding asterisks or doing any alignment/indentation changes). Either by updating the semantics of `--skip-javadoc-formatting`, or by introducing a new option (e.g. `--disable-javadoc-formatting`).
It would also be helpful to have an option where GJF only formats pure Javadoc (i.e. anything within `{@... }` and lines that start with a tag) and leaves anything else untouched (with an additional option to specify tags to exclude, such as `@snippet` while it's unsupported).
Contributor guide
Assessment
This issue has not been assessed yet.