palantir-java-format
palantir-java-format copied to clipboard
Support re-writing multiline docstrings into their multiline form
I often wish that people would write something like:
/** Returns true if the argument should be optional when fully parsed. */
public static boolean optionalWhenFullyParsed(Argument<?, ?> argument) {
return argument.isOptional() && argument.defaultValue().isEmpty();
}
rather than:
/**
* Returns true if the argument should be optional when fully parsed.
*/
public static boolean optionalWhenFullyParsed(Argument<?, ?> argument) {
return argument.isOptional() && argument.defaultValue().isEmpty();
}
We could compute whether it would fit on one line and rewrite it if it would. This would only apply to the case of multi-line docstrings that contain a single line. i.e. it would not include:
/**
* This is
* a silly
* docstring.
*/
public static boolean example()