pipeline icon indicating copy to clipboard operation
pipeline copied to clipboard

Cleanup: uplevel our technical hygiene by enabling additional Golang linters

Open bendory opened this issue 3 years ago • 5 comments

Feature request

golangci-lint which we have configured supports additional helpful linters that we are not using. This FR suggests that we uplevel our technical hygiene by enabling more linters and cleaning up the issues they identify.

Note: I'd like to see the same linter suite applied across all tektoncd repos.

Documentation: https://golangci-lint.run/usage/linters See also: http://goo.gle/go-style

Linters that I would like to see enabled:

  • [x] bodyclose - https://github.com/tektoncd/pipeline/pull/5924
  • [ ] conttainedctx
  • [x] decorder - https://github.com/tektoncd/pipeline/pull/5924
  • [x] depguard
  • [ ] dogsled
  • [ ] dupl
  • [x] dupword - https://github.com/tektoncd/pipeline/pull/5918
    • [x] https://github.com/tektoncd/pipeline/pull/5923
  • [x] errcheck
  • [ ] errchkjson
  • [ ] errname
  • [ ] errorlint
  • [ ] exhaustive
  • [ ] funlen
  • [ ] gocognit
  • [ ] goconst
  • [x] gocritic
  • [x] gofmt
  • [x] goimports
  • [x] gomodguard
  • [x] gosec
  • [x] gosimple -- https://github.com/tektoncd/pipeline/pull/5904
  • [x] govet
  • [ ] ineffassign
  • [ ] ireturn
  • [x] misspell
  • [x] ~nosnakecase~ (deprecated)
  • [x] revive
  • [ ] staticcheck
  • [x] thelper -- https://github.com/tektoncd/pipeline/pull/5927
  • [ ] tparallel
  • [x] typecheck -- https://github.com/tektoncd/pipeline/pull/5924
  • [x] unconvert
  • [ ] unparam
  • [x] unused -- https://github.com/tektoncd/pipeline/pull/5881
  • [x] usestdlibvars -- https://github.com/tektoncd/pipeline/pull/5918
  • [ ] varnamelen
  • [x] whitespace -- https://github.com/tektoncd/pipeline/pull/5889
  • [ ] wrapcheck

bendory avatar Dec 20 '22 16:12 bendory

I would assign this issue to me, but I don't seem to have the authority to do so. 🙃

bendory avatar Dec 20 '22 16:12 bendory

#5871 Added govet to our Golang linter suite #5881 Replaced deprecated deadcode linter with unused linter #5889 Enabled the whitespace linter.

bendory avatar Dec 20 '22 16:12 bendory

/assign @bendory (btw, if you comment /assign, it should automatically assign the issue to you 😉 )

vdemeester avatar Dec 21 '22 11:12 vdemeester

(ah lol, @jerop manually assigned you already 😂 )

vdemeester avatar Dec 21 '22 11:12 vdemeester

See also: https://github.com/tektoncd/community/pull/908 Add Go style guide to community standards (thanks @lbernick)

bendory avatar Dec 22 '22 14:12 bendory

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale with a justification. Stale issues rot after an additional 30d of inactivity and eventually close. If this issue is safe to close now please do so with /close with a justification. If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.

/lifecycle stale

Send feedback to tektoncd/plumbing.

tekton-robot avatar Jul 02 '23 17:07 tekton-robot

Stale issues rot after 30d of inactivity. Mark the issue as fresh with /remove-lifecycle rotten with a justification. Rotten issues close after an additional 30d of inactivity. If this issue is safe to close now please do so with /close with a justification. If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.

/lifecycle rotten

Send feedback to tektoncd/plumbing.

tekton-robot avatar Aug 01 '23 18:08 tekton-robot

Rotten issues close after 30d of inactivity. Reopen the issue with /reopen with a justification. Mark the issue as fresh with /remove-lifecycle rotten with a justification. If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.

/close

Send feedback to tektoncd/plumbing.

tekton-robot avatar Aug 31 '23 18:08 tekton-robot

@tekton-robot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity. Reopen the issue with /reopen with a justification. Mark the issue as fresh with /remove-lifecycle rotten with a justification. If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.

/close

Send feedback to tektoncd/plumbing.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

tekton-robot avatar Aug 31 '23 18:08 tekton-robot