From 4ff0bf2be31a95beaa95f8a3b447ece601bcefd1 Mon Sep 17 00:00:00 2001 From: Dan Lorenc Date: Thu, 2 Sep 2021 09:36:33 -0500 Subject: [PATCH] Switch the linter from golint to revive, and fix warnings. This finishes up the switch from the deprecated golint to revive, which is the replacement. This was started in #4206. This consisted of one new lint warning, and switching some suppressions to revive from golint. Signed-off-by: Dan Lorenc --- .golangci.yml | 2 +- cmd/webhook/main.go | 2 +- pkg/apis/pipeline/controller.go | 2 +- pkg/apis/pipeline/v1alpha1/cluster_task_conversion.go | 2 +- pkg/apis/pipeline/v1alpha1/pipeline_conversion.go | 2 +- pkg/apis/pipeline/v1alpha1/pipelinerun_conversion.go | 2 +- pkg/apis/pipeline/v1alpha1/task_conversion.go | 2 +- pkg/apis/pipeline/v1alpha1/taskrun_conversion.go | 2 +- pkg/apis/pipeline/v1beta1/cluster_task_conversion.go | 2 +- pkg/apis/pipeline/v1beta1/pipeline_conversion.go | 2 +- pkg/apis/pipeline/v1beta1/pipelinerun_conversion.go | 2 +- pkg/apis/pipeline/v1beta1/task_conversion.go | 2 +- pkg/apis/pipeline/v1beta1/taskrun_conversion.go | 2 +- pkg/reconciler/pipelinerun/resources/apply.go | 2 +- test/controller.go | 2 +- test/v1alpha1/controller.go | 2 +- 16 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index bfe8e7b65c7..b6951f025ef 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -10,7 +10,7 @@ linters: - goimports - gosec - gocritic - - golint + - revive - misspell output: uniq-by-line: false diff --git a/cmd/webhook/main.go b/cmd/webhook/main.go index 97e794d36f6..6c5ee4883eb 100644 --- a/cmd/webhook/main.go +++ b/cmd/webhook/main.go @@ -133,7 +133,7 @@ func newConfigValidationController(ctx context.Context, cmw configmap.Watcher) * } func newConversionController(ctx context.Context, cmw configmap.Watcher) *controller.Impl { - // nolint: golint + // nolint: revive var ( v1alpha1GroupVersion = v1alpha1.SchemeGroupVersion.Version v1beta1GroupVersion = v1beta1.SchemeGroupVersion.Version diff --git a/pkg/apis/pipeline/controller.go b/pkg/apis/pipeline/controller.go index 33d8d464c05..cc4cfdfc932 100644 --- a/pkg/apis/pipeline/controller.go +++ b/pkg/apis/pipeline/controller.go @@ -18,7 +18,7 @@ package pipeline const ( // PipelineRunControllerName holds the name of the PipelineRun controller - // nolint: golint + // nolint: revive PipelineRunControllerName = "PipelineRun" // TaskRunControllerName holds the name of the TaskRun controller diff --git a/pkg/apis/pipeline/v1alpha1/cluster_task_conversion.go b/pkg/apis/pipeline/v1alpha1/cluster_task_conversion.go index 61afb3e7a65..dd1af48e347 100644 --- a/pkg/apis/pipeline/v1alpha1/cluster_task_conversion.go +++ b/pkg/apis/pipeline/v1alpha1/cluster_task_conversion.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// nolint: golint +// nolint: revive package v1alpha1 import ( diff --git a/pkg/apis/pipeline/v1alpha1/pipeline_conversion.go b/pkg/apis/pipeline/v1alpha1/pipeline_conversion.go index 63abd3e78ba..ecde15b7e2e 100644 --- a/pkg/apis/pipeline/v1alpha1/pipeline_conversion.go +++ b/pkg/apis/pipeline/v1alpha1/pipeline_conversion.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// nolint: golint +// nolint: revive package v1alpha1 import ( diff --git a/pkg/apis/pipeline/v1alpha1/pipelinerun_conversion.go b/pkg/apis/pipeline/v1alpha1/pipelinerun_conversion.go index 929228cd526..f23d6552e3a 100644 --- a/pkg/apis/pipeline/v1alpha1/pipelinerun_conversion.go +++ b/pkg/apis/pipeline/v1alpha1/pipelinerun_conversion.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// nolint: golint +// nolint: revive package v1alpha1 import ( diff --git a/pkg/apis/pipeline/v1alpha1/task_conversion.go b/pkg/apis/pipeline/v1alpha1/task_conversion.go index b4e350a7107..0dcec4da0cf 100644 --- a/pkg/apis/pipeline/v1alpha1/task_conversion.go +++ b/pkg/apis/pipeline/v1alpha1/task_conversion.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// nolint: golint +// nolint: revive package v1alpha1 import ( diff --git a/pkg/apis/pipeline/v1alpha1/taskrun_conversion.go b/pkg/apis/pipeline/v1alpha1/taskrun_conversion.go index 3db9f734e42..898a9e4d4d2 100644 --- a/pkg/apis/pipeline/v1alpha1/taskrun_conversion.go +++ b/pkg/apis/pipeline/v1alpha1/taskrun_conversion.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// nolint: golint +// nolint: revive package v1alpha1 import ( diff --git a/pkg/apis/pipeline/v1beta1/cluster_task_conversion.go b/pkg/apis/pipeline/v1beta1/cluster_task_conversion.go index 275c64e24da..b17d0ff752d 100644 --- a/pkg/apis/pipeline/v1beta1/cluster_task_conversion.go +++ b/pkg/apis/pipeline/v1beta1/cluster_task_conversion.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// nolint: golint +// nolint: revive package v1beta1 import ( diff --git a/pkg/apis/pipeline/v1beta1/pipeline_conversion.go b/pkg/apis/pipeline/v1beta1/pipeline_conversion.go index b60929c343a..7ec0697b30d 100644 --- a/pkg/apis/pipeline/v1beta1/pipeline_conversion.go +++ b/pkg/apis/pipeline/v1beta1/pipeline_conversion.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// nolint: golint +// nolint: revive package v1beta1 import ( diff --git a/pkg/apis/pipeline/v1beta1/pipelinerun_conversion.go b/pkg/apis/pipeline/v1beta1/pipelinerun_conversion.go index 4ba1da51d92..9772707ed9c 100644 --- a/pkg/apis/pipeline/v1beta1/pipelinerun_conversion.go +++ b/pkg/apis/pipeline/v1beta1/pipelinerun_conversion.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// nolint: golint +// nolint: revive package v1beta1 import ( diff --git a/pkg/apis/pipeline/v1beta1/task_conversion.go b/pkg/apis/pipeline/v1beta1/task_conversion.go index c8a5a284923..1d150a2083f 100644 --- a/pkg/apis/pipeline/v1beta1/task_conversion.go +++ b/pkg/apis/pipeline/v1beta1/task_conversion.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// nolint: golint +// nolint: revive package v1beta1 import ( diff --git a/pkg/apis/pipeline/v1beta1/taskrun_conversion.go b/pkg/apis/pipeline/v1beta1/taskrun_conversion.go index 8ac827c83c9..0244cfb8310 100644 --- a/pkg/apis/pipeline/v1beta1/taskrun_conversion.go +++ b/pkg/apis/pipeline/v1beta1/taskrun_conversion.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// nolint: golint +// nolint: revive package v1beta1 import ( diff --git a/pkg/reconciler/pipelinerun/resources/apply.go b/pkg/reconciler/pipelinerun/resources/apply.go index 8773e295bff..a2aba9fa6d7 100644 --- a/pkg/reconciler/pipelinerun/resources/apply.go +++ b/pkg/reconciler/pipelinerun/resources/apply.go @@ -174,7 +174,7 @@ func ApplyTaskResultsToPipelineResults( customTaskStatuses[runStatus.PipelineTaskName] = runStatus } - var runResults []v1beta1.PipelineRunResult = nil + var runResults []v1beta1.PipelineRunResult stringReplacements := map[string]string{} for _, pipelineResult := range results { variablesInPipelineResult, _ := v1beta1.GetVarSubstitutionExpressionsForPipelineResult(pipelineResult) diff --git a/test/controller.go b/test/controller.go index fb97c51611c..435a99ac398 100644 --- a/test/controller.go +++ b/test/controller.go @@ -154,7 +154,7 @@ func AddToInformer(t *testing.T, store cache.Store) func(ktesting.Action) (bool, // SeedTestData returns Clients and Informers populated with the // given Data. -// nolint: golint +// nolint: revive func SeedTestData(t *testing.T, ctx context.Context, d Data) (Clients, Informers) { c := Clients{ Kube: fakekubeclient.Get(ctx), diff --git a/test/v1alpha1/controller.go b/test/v1alpha1/controller.go index b9472e38669..ebac2cce8f6 100644 --- a/test/v1alpha1/controller.go +++ b/test/v1alpha1/controller.go @@ -85,7 +85,7 @@ type Assets struct { // SeedTestData returns Clients and Informers populated with the // given Data. -// nolint: golint +// nolint: revive func SeedTestData(t *testing.T, ctx context.Context, d Data) (Clients, Informers) { c := Clients{ Kube: fakekubeclient.Get(ctx),