dominikh / go-tools

Staticcheck - The advanced Go linter
https://staticcheck.dev
MIT License
6.2k stars 377 forks source link

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

Open vkuzmin-uber opened 6 years ago

vkuzmin-uber commented 6 years ago

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.

dominikh commented 6 years ago

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.

vkuzmin-uber commented 6 years ago

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

bojanz commented 2 years ago

This is still a great idea.

@dominikh what do you say?

dominikh commented 2 years ago

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

ainar-g commented 2 years ago

@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.