Skip to content
This repository has been archived by the owner on Mar 26, 2020. It is now read-only.

golint warnings shouldn't be ignored #156

Closed
kshlm opened this issue Oct 27, 2016 · 8 comments
Closed

golint warnings shouldn't be ignored #156

kshlm opened this issue Oct 27, 2016 · 8 comments
Assignees

Comments

@kshlm
Copy link
Member

kshlm commented Oct 27, 2016

make verify currently runs golint as a part of gometalinter which is configured to mask warnings.
This has created a lot of code which doesn't follow the suggested Go coding style. This needs to be fixed.

@prashanthpai
Copy link
Contributor

I'm fixing most of it right now. Will send a PR soon.

@kshlm
Copy link
Member Author

kshlm commented Oct 27, 2016

@prashanthpai All of them? Or just for your PR? If it's all of them, awesome job!

@kshlm
Copy link
Member Author

kshlm commented Oct 27, 2016

Also make verify needs to be updated to not mask golint. It would be better to have separate golint run outside of gometalinter.

@prashanthpai
Copy link
Contributor

@kshlm Most of them, yes, except few places (transaction package) where it's generated code and adding //golint:ignore line into them did not seem to work for me.

Check out #157

@prashanthpai
Copy link
Contributor

@kshlm For some reason, make verify gets stuck on my system for a very long time. Running gometalinter directly doesn't run most of the other checks.

[ppai@gd2-1 glusterd2]$ gometalinter 
main.go:19::warning: cyclomatic complexity 11 of function main() is high (> 10) (gocyclo)
config.go:15:2:warning: const defaultRpcAddress should be defaultRPCAddress (golint)
config.go:16:2:warning: const defaultRpcPort should be defaultRPCPort (golint)
main.go:64:5:warning: should omit comparison to bool constant, can be simplified to !gdctx.Restart (gosimple)
config.go:46::warning: Errors unhandled.,LOW,HIGH (gas)
WARNING: deadline exceeded by linter aligncheck on . (try increasing --deadline)
WARNING: deadline exceeded by linter varcheck on . (try increasing --deadline)
WARNING: deadline exceeded by linter interfacer on . (try increasing --deadline)
WARNING: deadline exceeded by linter unconvert on . (try increasing --deadline)
WARNING: deadline exceeded by linter structcheck on . (try increasing --deadline)
WARNING: deadline exceeded by linter errcheck on . (try increasing --deadline)

@kshlm
Copy link
Member Author

kshlm commented Oct 27, 2016

For the problem with golint, check this kshlm@daec652

I'd begun working on this a little while ago. I stopped because I didn't want fix all the lint warning at the time.

@kshlm
Copy link
Member Author

kshlm commented Oct 27, 2016

@kshlm For some reason, make verify gets stuck on my system for a very long time. Running gometalinter directly doesn't run most of the other checks.

Most of the checkers got killed by the deadline. It's too short. I set the deadline to 5 minutes to have all checkers run.

@prashanthpai
Copy link
Contributor

For the problem with golint, check this kshlm/glusterd2@daec652

There's also golang/lint#249 and golang/lint#239

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

No branches or pull requests

2 participants