go-tools icon indicating copy to clipboard operation
go-tools copied to clipboard

stylecheck: comments of exported name should have a valid end of sentence

Open vkuzmin-uber opened this issue 7 years ago • 5 comments

Originally it was proposed at golint https://github.com/golang/lint/issues/374 and I sent appropriate pull request. Proposal is

"There is a rule https://github.com/golang/go/wiki/CodeReviewComments#comment-sentences. Comments should begin with the name of the thing being described and end in a period. Note that there are other symbols except a period that can be a valid end of sentence (at least !, ?). Apart from there are many tools that use comments to mark types and methods (like easyjson:json and golint's MATCH)."

Unfortunately golint's Issue was closed today and I didn't receive enough feedback to improve it and eventually get it committed. I talked to my colleagues and decided to try to get it at staticcheck.

We use this tool, this is probably going to become our only default linter. I know that you are working on it actively now.

Let me know, if you pre-approve it, I am willing to work on patch and submit a pull request.

vkuzmin-uber avatar Feb 21 '18 22:02 vkuzmin-uber

There is no code to send a patch against yet, as we have no equivalent to golint. I do plan on writing and releasing stylecheck soon, but first as part of the Staticcheck Pro branch. I'll keep this issue in mind when working on the rule set.

dominikh avatar Feb 22 '18 10:02 dominikh

Can you please clarify, what is Statickcheck Pro? Is it still Open Source branch?

vkuzmin-uber avatar Feb 23 '18 07:02 vkuzmin-uber

This is still a great idea.

@dominikh what do you say?

bojanz avatar Jul 12 '22 12:07 bojanz

Honestly, I'm undecided on the matter. I'm not convinced that it is worth it.

dominikh avatar Jul 12 '22 12:07 dominikh

@dominikh, as a data point, making sure that documentation is composed of actual, human-readable sentences and not just stuck-together words is one of the things that I have to spend quite a bit of time when reviewing code from junior devs. So having some automated help, even in the aggressive group, would be nice.

ainar-g avatar Jul 16 '22 08:07 ainar-g