From fa9e4f883696d545e3036165601174293ccf182f Mon Sep 17 00:00:00 2001 From: sonatard Date: Thu, 9 Jul 2020 16:31:26 +0900 Subject: [PATCH 1/3] Enable linters for golangci-lint --- .golangci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 3d9c7b405fc6..e8fe940feb23 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -73,6 +73,7 @@ linters: - dogsled - dupl - errcheck + - exhaustive - funlen - gochecknoinits - goconst @@ -91,6 +92,7 @@ linters: - lll - misspell - nakedret + - noctx - nolintlint - rowserrcheck - scopelint @@ -106,7 +108,6 @@ linters: # don't enable: # - asciicheck - # - exhaustive (TODO: enable after next release; current release at time of writing is v1.27) # - gochecknoglobals # - gocognit # - godot @@ -114,7 +115,6 @@ linters: # - goerr113 # - maligned # - nestif - # - noctx (TODO: enable after next release; current release at time of writing is v1.27) # - prealloc # - testpackage # - wsl From 48dba11a5ee7f15d949651b14bebdc77bebdf979 Mon Sep 17 00:00:00 2001 From: sonatard Date: Thu, 9 Jul 2020 17:01:01 +0900 Subject: [PATCH 2/3] Remove unused nolint --- pkg/commands/run.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/commands/run.go b/pkg/commands/run.go index e4887d587a50..0e0fe019b389 100644 --- a/pkg/commands/run.go +++ b/pkg/commands/run.go @@ -447,7 +447,7 @@ func (e *Executor) executeRun(_ *cobra.Command, args []string) { // to be removed when deadline is finally decommissioned func (e *Executor) setTimeoutToDeadlineIfOnlyDeadlineIsSet() { //lint:ignore SA1019 We want to promoted the deprecated config value when needed - deadlineValue := e.cfg.Run.Deadline // nolint:staticcheck + deadlineValue := e.cfg.Run.Deadline if deadlineValue != 0 && e.cfg.Run.Timeout == defaultTimeout { e.cfg.Run.Timeout = deadlineValue } From a06cab3137fae5c69c0bf318dd936f3b8f7f8811 Mon Sep 17 00:00:00 2001 From: sonatard Date: Thu, 9 Jul 2020 17:06:10 +0900 Subject: [PATCH 3/3] Fix lint --- pkg/commands/run.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/commands/run.go b/pkg/commands/run.go index 0e0fe019b389..c1ccf86f31c4 100644 --- a/pkg/commands/run.go +++ b/pkg/commands/run.go @@ -446,7 +446,7 @@ func (e *Executor) executeRun(_ *cobra.Command, args []string) { // to be removed when deadline is finally decommissioned func (e *Executor) setTimeoutToDeadlineIfOnlyDeadlineIsSet() { - //lint:ignore SA1019 We want to promoted the deprecated config value when needed + // nolint:staticcheck deadlineValue := e.cfg.Run.Deadline if deadlineValue != 0 && e.cfg.Run.Timeout == defaultTimeout { e.cfg.Run.Timeout = deadlineValue