protokit icon indicating copy to clipboard operation
protokit copied to clipboard

Comments scrub function a feature or a bug?

Open ruanspies opened this issue 3 years ago • 0 comments

Thanks for the great repo @pseudomuto.

We have been using protokit as part of our process of auto-generating API reference documentation from proto files. We are experiencing some issues caused by the scrub function in comments.go

https://github.com/pseudomuto/protokit/blob/dc6fd1c8003a61bcd77ddc148e4d49946fbf8c23/comments.go#L91

The function obviously trims white spaces but this causes grammar issues in the resulting comments.

Rather than having a single line string, proto comments are often structured in the following way to improve readability in the actual proto:


// The definition of a book resource in the
// context of the university library.
message Book{}

Due to the scrub function, this will cause the sentence to include thecontext rather than having a space between the words.

This is our primary use case for using comments so just want to check whether scrub is actually used for cases I am not envisioning and whether I can submit a PR to remove it.

ruanspies avatar Sep 30 '22 09:09 ruanspies