Skip to content
This repository has been archived by the owner on Oct 19, 2022. It is now read-only.

Difference/relation to Revive's var-naming check? #10

Open
scop opened this issue Jul 19, 2022 · 4 comments
Open

Difference/relation to Revive's var-naming check? #10

scop opened this issue Jul 19, 2022 · 4 comments

Comments

@scop
Copy link

scop commented Jul 19, 2022

On the surface, this linter seems to be doing a subset of what Revive's var-naming check/rule does, but with less configurability and some problems which don't exist in Revive, like #9.

In what kind of scenarios would you recommend using this linter instead?

@sivchari
Copy link
Owner

sivchari commented Jul 19, 2022

Hi, @scop .
nosnakecase checks all naming contained underscore in Go code. There are a few cases that Go indicates to use underscore.
And, this is how it is written in the Effective Go.

MixedCaps
Finally, the convention in Go is to use MixedCaps or mixedCaps rather than underscores to write multiword names.

So, I recommend this linter that someone wanna
follow the naming rule Go recommends.

p.s. I'll fix #9 as soon as possible.

@scop
Copy link
Author

scop commented Jul 22, 2022

Thanks.

Revive's var-naming checks for underscores, too: https://github.com/mgechev/revive/blob/0f4df1ca407c49d4a89e6eef07440d7af5c6d267/rule/var-naming.go#L120 (as well as other things related to Effective Go guidelines).

Do you know of a specific case involving underscores that revive would not catch, but this linter would?

@scop
Copy link
Author

scop commented Jul 22, 2022

(Despite the name, revive's var-naming is not limited to checking variable names, it checks them on other things as well such as at least consts, package, and function names.)

@favonia
Copy link

favonia commented Aug 1, 2022

One difference is that this tool rejects _name while revive accepts it. However, I am with revive here and feel this tool should accept it as well. In general, revive gave me the impression that its checking is more refined and tuned. So, I would also like to see a bad case that revive does not report but this tool does.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants