Skip to content

Commit

Permalink
Switch the linter from golint to revive, and fix warnings.
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Dan Lorenc committed Sep 2, 2021
1 parent 7e52ce7 commit 4ff0bf2
Show file tree
Hide file tree
Showing 16 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ linters:
- goimports
- gosec
- gocritic
- golint
- revive
- misspell
output:
uniq-by-line: false
Expand Down
2 changes: 1 addition & 1 deletion cmd/webhook/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/pipeline/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/pipeline/v1alpha1/cluster_task_conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/pipeline/v1alpha1/pipeline_conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/pipeline/v1alpha1/pipelinerun_conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/pipeline/v1alpha1/task_conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/pipeline/v1alpha1/taskrun_conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/pipeline/v1beta1/cluster_task_conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/pipeline/v1beta1/pipeline_conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/pipeline/v1beta1/pipelinerun_conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/pipeline/v1beta1/task_conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/pipeline/v1beta1/taskrun_conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
2 changes: 1 addition & 1 deletion pkg/reconciler/pipelinerun/resources/apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion test/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion test/v1alpha1/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit 4ff0bf2

Please sign in to comment.