go-git icon indicating copy to clipboard operation
go-git copied to clipboard

golangci-lint: Enable linters

Open pjbgf opened this issue 1 month ago • 3 comments

Feature Description

We can start with the linters below and expand further as we go:

  • [x] errcheck
  • [x] govet
  • [ ] gosec
  • [x] ineffassign
  • [x] staticcheck
  • [x] unused
  • [x] modernize
  • [x] dupl
  • [x] misspell
  • [x] prealloc
  • [x] revive
  • [x] whitespace
  • [x] paralleltest

Such changes tend to stale other active PRs as it will touch a large amount of files, so:

  • Let's only start this after #1751 is done.
  • Do a single linter per commit - for commit message *: will make the PR validatio check happy.
  • A PR may enable multiple linters if the total amount of files changed are up to 15. If more files are affected, please keep a linter per PR.

pjbgf avatar Nov 25 '25 22:11 pjbgf

@pjbgf you can assign it to me.

ferhatelmas avatar Nov 25 '25 23:11 ferhatelmas

I would suggest gocritic as well. https://github.com/go-critic/go-critic

ferhatelmas avatar Nov 28 '25 12:11 ferhatelmas

How about paralleltest? It could help speed up the tests.

onee-only avatar Dec 01 '25 07:12 onee-only