Skip to content

Commit

Permalink
Enable golang-ci linters
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewSirenko committed Nov 1, 2024
1 parent 06e4a1e commit 32e5e01
Showing 1 changed file with 28 additions and 29 deletions.
57 changes: 28 additions & 29 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,17 @@ linters:
- gci
- ginkgolinter
- gocheckcompilerdirectives
- gochecknoinits
- gochecksumtype
- goconst
- gocritic
- godot
- gofmt
- goheader
- goimports
- gomodguard
- goprintffuncname
- gosec
- gosimple
- gosmopolitan
- grouper
Expand All @@ -84,11 +88,13 @@ linters:
- noctx
- nolintlint
- nosprintfhostport
- perfsprint
- prealloc
- predeclared
- promlinter
- protogetter
- reassign
- revive
- rowserrcheck
- sloglint
- spancheck
Expand All @@ -109,39 +115,32 @@ linters:
- wastedassign
- whitespace
- zerologlint
- goconst
- gochecknoinits
- perfsprint
- revive
- gosec
- godot # End all godoc comments with period
disable:
- govet # We already run with `make verify/govet`
# We do not use
- gomoddirectives # We need `replace` in `go.mod`
- cyclop # Cyclomatic complexity
- depguard # We don't guard against dependencies
- testpackage # Require separate test package to catch leaky unexported dependencies
- dupl # Tracks code duplication. Too much duplication in tests. False positives in non-tests
- exhaustruct # Explicitly instantiating all structs is painful for K8s structs
- funlen # Long func names happen
- varnamelen # Long var names happen
- maintidx # Maintainability index
- cyclop # Cyclomatic complexity
- gocognit # Cognitive complexity
- wsl # Too strict of a whitespace linter
# TODO Investigate FIXME
- err113 # TODO FIXME do not create errors dynamically from scratch. Instead wrap static (package-level) error. 2 points
- wrapcheck # TODO ^^
- gochecknoglobals # TODO FIXME A whole 2 point task on its own
- paralleltest # TODO FIXME (Too many tests that aren't parallelized right now, probably half a day to attempt to mark the ones we can)
- nestif # TODO whole refactoring/readability task, should split up
- godox # TODO FIXME audit our project TODOs
# TODO Q: Consult with team
- gofumpt # We don't rely on gofumpt
- gomnd # Magic Number Detection. Many false positives.
- gomoddirectives # We need `replace` in `go.mod`
- interfacebloat # No more than 10 interface methods
- ireturn # Accept interfaces return concrete types
- lll # Limit line length
- gofumpt # Rely on gofumpt's stricter formatting opinions
- ireturn # Always accept interfaces return concrete types (gopherism)
- nlreturn # Always have emptyline before return
- nonamedreturns # No using named returns in functions. Maybe nolint a few of the places it actually leads to cleaner code
- exhaustruct # Forces you to explicitly instantiate all structs. REALLY painful for kubernetes structs...
- interfacebloat # Cloud and Mounter have 15 methods instead of linter's recommended 10... Smell or necessary? We can nolint specific ones
- mnd # Magic Number Detection. Many false positives, still worth with nolint?
- gomnd # Many false positives, still worth with nolint?
- dupl # Tracks code duplication. Brutal amount of duplication in tests. False positives in non-tests.
- maintidx # Maintainability index
- mnd # Magic Number Detection. Many false positives
- nestif # Don't allow too many nested if statements
- nlreturn # Always have empty line before return
- nonamedreturns
- testpackage # Require separate test package to catch leaky unexported dependencies
- varnamelen # Long var names happen
- wsl # Too strict of a whitespace linter
# Consider adding in future
- err113 # Do not create errors dynamically from scratch. Instead, wrap static (package-level) error.
- wrapcheck # Same as err113
- gochecknoglobals # Do not allow global variables
- godox # Do not allow TODOs
- paralleltest # There are many tests that aren't parallelized

0 comments on commit 32e5e01

Please sign in to comment.