square / wire

gRPC and protocol buffers for Android, Kotlin, Swift and Java.
https://square.github.io/wire/
Apache License 2.0
4.25k stars 570 forks source link

Docs should wrap at line limit, not at "\n" #1089

Open Egorand opened 5 years ago

Egorand commented 5 years ago

Proto:

enum Option {
  /**
  * This is the default option. Its documentation should wrap not at
  * the "\n" symbol but at the right place according to the line limit.
  */
  DEFAULT = 1;
}

generates:

enum class Option(
  override val value: Int
) : WireEnum {
  /**
   * This is the default option. Its documentation should wrap not at
   * the "\n" symbol but at the right place according to the line limit.
   */
  DEFAULT(1);
...

should be:

enum class Option(
  override val value: Int
) : WireEnum {
  /**
   * This is the default option. Its documentation should wrap not at the "\n" symbol but at the 
   * right place according to the line limit.
   */
  DEFAULT(1);
...
JakeWharton commented 5 years ago

Does this matter in practice? Mangling documentation is a slippery slope given the presence of things like ASCII charts and lists.

Egorand commented 5 years ago

Not that important I guess. JavaGenerator does sanitize docs though, do you anticipate it being more error-prone with KDoc?

JakeWharton commented 5 years ago

If you don't sanitize the javadoc task will actually fail. I think there's a difference between stuff like escaping and actually reflowing. The former is required and kinda easy but the latter is nice-to-have and probably really hard to get right.

Egorand commented 5 years ago

Got it, that's fair. I'll leave it for now.