exercism / go-analyzer

GNU Affero General Public License v3.0
10 stars 12 forks source link

golint: golint is deprecated and frozen #16

Open andrerfcsantos opened 3 years ago

andrerfcsantos commented 3 years ago

Since golint is unmaintained, deprecated and frozen, maybe we should stop suggesting it and start suggesting alternatives like staticcheck and go vet.

Or maybe refer to IDE integrations, like we do with gofmt.

Relevant issue: https://github.com/golang/go/issues/38968

iHiD commented 3 years ago

(cc @bitfield and @tehsphinx)

tehsphinx commented 3 years ago

According to golangci-lint, the drop in replacement is called revive:

image

I'd argue however, that students are best served installing and running golangci-lint with the default settings. As that is highly configurable, they can later adjust that to their needs.

bitfield commented 3 years ago

staticcheck is the default linter for VS Code now, and it's probably the most widely useful if we're to recommend a linter.

However, one critical thing golint does that staticcheck doesn't is to warn about missing documentation comments for functions, variables, and other public identifiers. We could presumably do this with the auto analyzer, couldn't we?

junedev commented 2 years ago

I am unsure what the best way forward is regarding the linter we use in the analyzer.

Summarizing the options mentioned above:

I will ask for input from other maintainers / Go people on Slack.

fgm commented 2 years ago

staticcheck is supposed to include most of the golint checks (see https://github.com/dominikh/go-tools/issues/542), plus many more, so not many reasons to use revive. golangci-lint, being a metalinter bundling many tools, has frequent upgrade issues. For example even now, it cannot run several of its linters on 1.18, and has some peculiar failure modes needing cache cleanup. In most cases, I prefer the combination of goimports + staticcheck. The extra checks in golangci-lint add little value IMHO.

andrerfcsantos commented 1 year ago

Been thinking a bit more about this and I'm also in favor of using staticcheck as our standard linter.

junedev commented 1 year ago

Agreed. I also thought about this more and I have the same feelings about this as @fgm voiced above.

Nevertheless, I think an additional analyzer check for missing comments on exported functions would be good as those (in the correct format) are very idiomatic for Go. This was suggested above by bitfield.