diff --git a/.golangci.yml b/.golangci.yml index 8d23a82..367df6e 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,3 +1,5 @@ +version: 2 + run: timeout: 5m @@ -12,48 +14,11 @@ linters-settings: excludes: - G115 +formatters: + enable-all: true + linters: - enable: - - asciicheck - - bodyclose - - dupl - - errcheck - - exhaustive - - gochecknoinits - - gocognit - - goconst - - gocritic - - gocyclo - - godot - - godox - - gofmt - - goheader - - gomodguard - - goprintffuncname - - gosec - - gosimple - - govet - - ineffassign - - lll - - makezero - - misspell - - nakedret - - nestif - - noctx - - nolintlint - - predeclared - - rowserrcheck - - sqlclosecheck - - staticcheck - - stylecheck - - testpackage - - tparallel - - typecheck - - unconvert - - unparam - - unused - - unused - - whitespace + enable-all: true disable: # We don't have high-performance requirements at this moment, so sacrificing @@ -70,8 +35,6 @@ linters: # Style linters that are total nuts. - wsl - - gofumpt - - goimports - funlen # Enough parallelism for now. @@ -98,6 +61,9 @@ linters: # Needs package whitelists - depguard + # Not all errors need to be checked + - errcheck + issues: # Don't hide multiple issues that belong to one class since GitHub annotations can handle them all nicely. max-issues-per-linter: 0 diff --git a/internal/command/context/create.go b/internal/command/context/create.go index 4bf81cd..bb7747c 100644 --- a/internal/command/context/create.go +++ b/internal/command/context/create.go @@ -90,7 +90,7 @@ func runCreate(cmd *cobra.Command, args []string) error { Label: "Service account name:", Validate: func(s string) error { if s == "" { - //nolint:goerr113,golint,stylecheck // this is not a standard error + //nolint:staticcheck // this is not a standard error return fmt.Errorf("Service account name cannot be empty.") } @@ -110,7 +110,7 @@ func runCreate(cmd *cobra.Command, args []string) error { Label: "Service account token:", Validate: func(s string) error { if s == "" { - //nolint:goerr113,golint,stylecheck // this is not a standard error + //nolint:staticcheck // this is not a standard error return fmt.Errorf("Service account token cannot be empty.") } @@ -262,7 +262,7 @@ func probeControllerCertificate(ctx context.Context, controllerURL *url.URL) (*x Label: "Are you sure you want to establish trust to this certificate? (yes/no)", Validate: func(s string) error { if s != "yes" && s != "no" { - //nolint:goerr113,golint,stylecheck // this is not a standard error + //nolint:staticcheck // this is not a standard error return fmt.Errorf("Please specify \"yes\" or \"no\".") }