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 warnings #70

Closed
timfallmk opened this issue Nov 29, 2017 · 1 comment
Closed

Fix linter warnings #70

timfallmk opened this issue Nov 29, 2017 · 1 comment

Comments

@timfallmk
Copy link
Contributor

I've submitted fixes for the critical linter failures in #69 and #68, but there remains a large number of non-critical warnings. In an effort to clean up the code a little, we should probably take care of these.

I'm using gometalinter to run a number of standard linters at once. My command, along with the output is below.

go get github.com/alecthomas/gometalinter
gometalinter --install


gometalinter --vendor --skip testdata -t --aggregate ./...
cli.go:76::warning: cyclomatic complexity 21 of function (*CLI).Run() is high (> 10) (gocyclo)
github_test.go:180::warning: declaration of "err" shadows declaration at github_test.go:167 (vetshadow)
github_test.go:194::warning: declaration of "err" shadows declaration at github_test.go:167 (vetshadow)
cli.go:34:1:warning: ExitCodeRepoNotFound is unused (deadcode)
cli.go:51:2:warning: exported const DefaultParallel should have comment (or a comment on this block) or be unexported (golint)
cli.go:20:1:warning: EnvStackTrace is unused (deadcode)
ghr_test.go:195::warning: declaration of "err" shadows declaration at ghr_test.go:164 (vetshadow)
github_test.go:173::warning: declaration of "err" shadows declaration at github_test.go:167 (vetshadow)
github_test.go:179::warning: declaration of "filename" shadows declaration at github_test.go:178 (vetshadow)
cli.go:34:1:warning: ExitCodeInvalidURL is unused (deadcode)
cli.go:22::warning: Potential hardcoded credentials,HIGH,LOW (gas)
cli.go:270::warning: declaration of "err" shadows declaration at cli.go:232 (vetshadow)
cli.go:279::warning: declaration of "err" shadows declaration at cli.go:232 (vetshadow)
cli_test.go:37::warning: declaration of "err" shadows declaration at cli_test.go:28 (vetshadow)
ghr_test.go:170::warning: declaration of "err" shadows declaration at ghr_test.go:164 (vetshadow)
ghr_test.go:180::warning: declaration of "err" shadows declaration at ghr_test.go:164 (vetshadow)
cli_test.go:33::warning: declaration of "err" shadows declaration at cli_test.go:28 (vetshadow)
ghr_test.go:37::warning: cyclomatic complexity 12 of function TestGHR_CreateReleaseWithExistingRelease() is high (> 10) (gocyclo)
cli.go:30:2:warning: exported const EnvStackTrace should have comment (or a comment on this block) or be unexported (golint)
cli.go:61:1:warning: comment on exported function PrintRedf should be of the form "PrintRedf ..." (golint)
cli.go:34:1:warning: ExitCodeRleaseError is unused (deadcode)
ghr.go:27:5:warning: error return value not checked (non-boolean condition in if statement) (errcheck)
ghr.go:27:5:warning: non-boolean condition in if statement (gotype, interfacer, maligned, megacheck, unconvert)
ghr.go:27:5:warning: unused struct field non-boolean condition in if statement (structcheck)
github_test.go:98::warning: cyclomatic complexity 11 of function TestGitHubClient_Upload() is high (> 10) (gocyclo)
github_test.go:112::warning: declaration of "err" shadows declaration at github_test.go:106 (vetshadow)
ghr.go:27:5:warning: unused variable or constant non-boolean condition in if statement (varcheck)
@Songmu
Copy link
Collaborator

Songmu commented Aug 25, 2018

Thank you for reporting.
I confirmed them, but there was no critical problem.
I think that using golint and govet are sufficient in CI, so close this issue.

@Songmu Songmu closed this as completed Aug 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants