jhipster / prettier-java

Prettier Java Plugin
http://www.jhipster.tech/prettier-java/
Apache License 2.0
1.06k stars 103 forks source link

Wrap long javadoc lines where possible #651

Open xenoterracide opened 4 months ago

xenoterracide commented 4 months ago

Prettier-Java 2.6.0

# Options (if any):
--print-width 120

Input:

/**
 * Build Service for Git. Primary goal is to allow for lazy initialization of the Git object and keeping it open for later usage.
 * This Service should not be considered a published API, and may change or be removed in future versions.
 */

Output:

/**
 * Build Service for Git. Primary goal is to allow for lazy initialization of the Git object and keeping it open for later usage.
 * This Service should not be considered a published API, and may change or be removed in future versions.
 */

Expected behavior:

/**
 * Build Service for Git. Primary goal is to allow for lazy initialization of the Git object and keeping it open for
 * later usage. This Service should not be considered a published API, and may change or be removed in future versions.
 */

beware of word breaking though, this for example shouldn't try to wrap even though it's too long. Note: I'm not certain if this would try to reformat now, and it isn't javadoc, but maybe this issue applies to all comments and I just haven't noticed.

  // https://github.com/diffplug/spotless/blob/224f8f96df3ad42cac81064a0461e6d4ee91dcaf/plugin-gradle/src/main/java/com/diffplug/gradle/spotless/GitRatchetGradle.java#L35