guide icon indicating copy to clipboard operation
guide copied to clipboard

Refactor: change golint to revive in styleguide.md

Open gvencadze opened this issue 4 years ago • 4 comments

golint is deprecated and recommends switch to revive

gvencadze avatar May 15 '21 16:05 gvencadze

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar May 15 '21 16:05 CLAassistant

I wasn't able to find any recommendations on the golint README to switch to revive, can you point to where this is recommended? The only recommendation I was able to find is:

NOTE: Golint is deprecated and frozen. There's no drop-in replacement for it, but tools such as Staticcheck and go vet should be used instead.

prashantv avatar May 15 '21 17:05 prashantv

Recommendation was showed in log of running golint in github CI. Or better I should just add link to revive (instead of removing) and write that golint is deprecated?

level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive."

gvencadze avatar May 15 '21 18:05 gvencadze

We haven't evaluated revive internally yet (to my knowledge, anyway), though we're aware of it and on paper it does look promising.

We don't recommend things that we don't do/use ourselves, so I'd prefer to wait on mentioning/recommending revive until we've had a chance to look into/adopt it internally first. I'll start a conversation internally about this, and we can leave the PR open in the meantime. (Note that whenever we do make this change, it should also include #123.)

mway avatar May 16 '21 13:05 mway

lurking, was a consensus ever drawn from this? How do you enforce your style guides internally?

conrad760 avatar Apr 04 '23 14:04 conrad760

FWIW, I've switched from golint to revive in some of my personal projects. It's almost a drop-in replacement minus:

  • it does not exit with a non-zero status code by default if there are issues
  • the default rule set as of revive 1.3.0 does a bit more than golint, and we might not agree with all of those rules

If this style guide recommends revive, we should provide a sample recommended configuration.

abhinav avatar Apr 07 '23 21:04 abhinav