Skip to content

Commit

Permalink
fixup! Additional fixes (to be squashed)
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewSirenko committed Nov 3, 2024
1 parent 4af6753 commit f81d51d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 82 deletions.
86 changes: 5 additions & 81 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,95 +35,19 @@ linters-settings:
- "github.com/onsi/gomega"
- "github.com/onsi/ginkgo/v2"
linters:
enable:
- asasalint
- asciicheck
- bidichk
- bodyclose
- canonicalheader
- containedctx
- contextcheck
- copyloopvar
- decorder
- dogsled
- dupword
- durationcheck
- errcheck
- errchkjson
- errname
- errorlint
- exhaustive
- fatcontext
- forbidigo
- forcetypeassert
- gci
- ginkgolinter
- gocheckcompilerdirectives
- gochecknoinits
- gochecksumtype
- goconst
- gocritic
- godot
- gofmt
- goheader
- goimports
- gomodguard
- goprintffuncname
- gosec
- gosimple
- gosmopolitan
- grouper
- importas
- inamedparam
- ineffassign
- intrange
- loggercheck
- makezero
- mirror
- misspell
- musttag
- nakedret
- nilerr
- nilnil
- noctx
- nolintlint
- nosprintfhostport
- perfsprint
- prealloc
- predeclared
- promlinter
- protogetter
- reassign
- revive
- rowserrcheck
- sloglint
- spancheck
- sqlclosecheck
- staticcheck
- stylecheck
- tagalign
- tagliatelle
- tenv
- testableexamples
- testifylint
- thelper
- tparallel
- unconvert
- unparam
- unused
- usestdlibvars
- wastedassign
- whitespace
- zerologlint
enable-all: true
disable:
- govet # We already run with `make verify/govet`
# We do not use
- cyclop # Cyclomatic complexity
- depguard # We don't guard against dependencies
- dupl # Tracks code duplication. Too much duplication in tests. False positives in non-tests
- execinquery # Deprecated but enabled-by-default
- exhaustruct # Explicitly instantiating all structs is painful for K8s structs
- exportloopref # Deprecated but enabled-by-default
- funlen # Long func names happen
- gocognit # Cognitive complexity
- gocyclo # Cyclomatic complexity
- gofumpt # We don't rely on gofumpt
- gomnd # Magic Number Detection. Many false positives.
- gomoddirectives # We need `replace` in `go.mod`
Expand All @@ -134,7 +58,6 @@ linters:
- 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
Expand All @@ -143,4 +66,5 @@ linters:
- wrapcheck # Same as err113
- gochecknoglobals # Do not allow global variables
- godox # Do not allow TODOs
- nonamedreturns # Need to nolint/refactor a few places our code
- paralleltest # There are many tests that aren't parallelized
4 changes: 3 additions & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package main

import (
"context"
"fmt"
"os"
"strings"
"time"
Expand Down Expand Up @@ -107,7 +108,8 @@ func main() {
klog.ErrorS(err, "failed to get version")
klog.FlushAndExit(klog.ExitFlushTimeout, 1)
}
klog.Info(versionInfo)
//nolint:forbidigo
fmt.Println(versionInfo)
os.Exit(0)
}

Expand Down

0 comments on commit f81d51d

Please sign in to comment.