Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix linter errors in fake and kvstore package #383

Open
praveingk opened this issue Jun 11, 2024 · 0 comments
Open

Fix linter errors in fake and kvstore package #383

praveingk opened this issue Jun 11, 2024 · 0 comments
Labels
easy good first issue Good for newcomers
Milestone

Comments

@praveingk
Copy link
Collaborator

Steps to reproduce:

  1. Replace .golangci.yml to this version
  2. Run golangci-lint run --config=./.golangci.yaml ./pkg/fake/... ./pkg/kvstore/...
pkg/fake/cloudplugin/fake_cloud_plugin.go:17:9: var-naming: don't use an underscore in package name (revive)
pkg/fake/cloudplugin/fake_cloud_plugin.go:38:2: var-naming: var BgpPeeringIpAddresses should be BgpPeeringIPAddresses (revive)
pkg/fake/cloudplugin/fake_cloud_plugin.go:39: line is 201 characters (lll)
pkg/fake/cloudplugin/fake_cloud_plugin.go:48: line is 151 characters (lll)
pkg/fake/cloudplugin/fake_cloud_plugin.go:52: line is 166 characters (lll)
pkg/fake/cloudplugin/fake_cloud_plugin.go:56: line is 175 characters (lll)
pkg/fake/cloudplugin/fake_cloud_plugin.go:60: line is 154 characters (lll)
pkg/fake/cloudplugin/fake_cloud_plugin.go:64: line is 172 characters (lll)
pkg/fake/cloudplugin/fake_cloud_plugin.go:77: line is 145 characters (lll)
pkg/fake/cloudplugin/fake_cloud_plugin.go:81: line is 196 characters (lll)
pkg/fake/cloudplugin/fake_cloud_plugin.go:85:28: unexported-return: exported func NewFakePluginServer returns unexported type *cloud_plugin.fakeCloudPluginServer, which can be annoying to use (revive)
pkg/fake/kvstore/fake_kvstore.go:38:33: unused-parameter: parameter 'c' seems to be unused, consider removing or renaming it as _ (revive)
pkg/fake/kvstore/fake_kvstore.go:45:33: unused-parameter: parameter 'c' seems to be unused, consider removing or renaming it as _ (revive)
pkg/fake/kvstore/fake_kvstore.go:52:36: unused-parameter: parameter 'c' seems to be unused, consider removing or renaming it as _ (revive)
pkg/fake/orchestrator/rest/fake_orchestrator_rest_server.go:43:1: paramTypeCombine: func(url string, pattern string) bool could be replaced with func(url, pattern string) bool (gocritic)
pkg/fake/orchestrator/rest/fake_orchestrator_rest_server.go:63:1: paramTypeCombine: func(url string, pattern string) map[string]string could be replaced with func(url, pattern string) map[string]string (gocritic)
pkg/fake/orchestrator/rest/fake_orchestrator_rest_server.go:156:35: parameter name 'w' is too short for the scope of its usage (varnamelen)
pkg/fake/orchestrator/rest/fake_orchestrator_rest_server.go:178:16: returnAfterHttpError: Possibly return is missed after the http.Error call (gocritic)
pkg/fake/orchestrator/rest/fake_orchestrator_rest_server.go:182:16: returnAfterHttpError: Possibly return is missed after the http.Error call (gocritic)
pkg/fake/orchestrator/rest/fake_orchestrator_rest_server.go:190:16: returnAfterHttpError: Possibly return is missed after the http.Error call (gocritic)
pkg/fake/orchestrator/rest/fake_orchestrator_rest_server.go:194:16: returnAfterHttpError: Possibly return is missed after the http.Error call (gocritic)
pkg/fake/orchestrator/rest/fake_orchestrator_rest_server.go:263:74: unnecessary conversion (unconvert)
pkg/fake/orchestrator/rest/fake_orchestrator_rest_server.go:287:67: unnecessary conversion (unconvert)
pkg/fake/orchestrator/rpc/fake_orchestrator_rpc_server.go:41: line is 187 characters (lll)
pkg/fake/orchestrator/rpc/fake_orchestrator_rpc_server.go:52:3: assignOp: replace `f.Counter = f.Counter + 1` with `f.Counter++` (gocritic)
pkg/fake/orchestrator/rpc/fake_orchestrator_rpc_server.go:58: line is 155 characters (lll)
pkg/fake/orchestrator/rpc/fake_orchestrator_rpc_server.go:62: line is 149 characters (lll)
pkg/fake/orchestrator/rpc/fake_orchestrator_rpc_server.go:76: line is 141 characters (lll)
pkg/fake/orchestrator/rpc/fake_orchestrator_rpc_server.go:83: line is 141 characters (lll)
pkg/fake/orchestrator/rpc/fake_orchestrator_rpc_server.go:92: line is 150 characters (lll)
pkg/fake/orchestrator/rpc/fake_orchestrator_rpc_server.go:121: line is 131 characters (lll)
pkg/fake/tagservice/fake_tag_service.go:37:2: var-naming: var TagUri should be TagURI (revive)
pkg/fake/tagservice/fake_tag_service.go:38:2: var-naming: var TagIp should be TagIP (revive)
pkg/fake/tagservice/fake_tag_service.go:39:2: var-naming: var ResolvedTagIp should be ResolvedTagIP (revive)
pkg/fake/tagservice/fake_tag_service.go:48:39: unused-parameter: parameter 'c' seems to be unused, consider removing or renaming it as _ (revive)
pkg/fake/tagservice/fake_tag_service.go:61: line is 141 characters (lll)
pkg/fake/tagservice/fake_tag_service.go:63:3: var-naming: var newUri should be newURI (revive)
pkg/fake/tagservice/fake_tag_service.go:64: line is 135 characters (lll)
pkg/fake/tagservice/fake_tag_service.go:69: line is 136 characters (lll)
pkg/fake/tagservice/fake_tag_service.go:73: line is 138 characters (lll)
pkg/fake/tagservice/fake_tag_service.go:80: line is 156 characters (lll)
pkg/fake/tagservice/fake_tag_service.go:87: line is 138 characters (lll)
pkg/fake/tagservice/fake_tag_service.go:91: line is 144 characters (lll)
pkg/fake/tagservice/fake_tag_service.go:98: line is 153 characters (lll)
pkg/fake/tagservice/fake_tag_service.go:100: line is 131 characters (lll)
pkg/kvstore/kvstore.go:30:1: paramTypeCombine: func(key string, cloud string, namespace string) string could be replaced with func(key, cloud, namespace string) string (gocritic)
pkg/kvstore/kvstore.go:39:45: unexported-return: exported func NewKVStoreServer returns unexported type *kvstore.kvStoreServer, which can be annoying to use (revive)
pkg/kvstore/kvstore.go:72:1: paramTypeCombine: func(dbPort int, serverPort int, clearKeys bool) could be replaced with func(dbPort, serverPort int, clearKeys bool) (gocritic)
48 issues:
* gocritic: 9
* lll: 24
* revive: 12
* unconvert: 2
* varnamelen: 1
@praveingk praveingk added this to the vNext milestone Jun 11, 2024
@divega divega added good first issue Good for newcomers easy labels Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
easy good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants