Skip to content
This repository has been archived by the owner on Nov 28, 2024. It is now read-only.

Commit

Permalink
fix: update golangci
Browse files Browse the repository at this point in the history
  • Loading branch information
Skarlso committed Apr 30, 2024
1 parent b4ea069 commit c4f3f5e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 19 deletions.
17 changes: 7 additions & 10 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
run:
go: "1.21"
go: "1.22"
timeout: 10m
tests: false
allow-parallel-runners: true
skip-dirs:
- "./*/mock"
skip-files:
- "pkg/ocm/fakes/ocm.go"

linters-settings:
funlen:
lines: 150
statements: 70
staticcheck:
go: "1.21"
go: "1.22"
stylecheck:
go: "1.21"
go: "1.22"
cyclop:
max-complexity: 20
skip-tests: true
Expand All @@ -25,9 +21,6 @@ linters-settings:
line-length: 150
misspell:
locale: US
govet:
check-shadowing: true
nilaway:
nolintlint:
allow-unused: false
require-explanation: true
Expand All @@ -43,6 +36,10 @@ linters-settings:
- ip

issues:
exclude-dirs:
- "./*/mock"
exclude-files:
- pkg/ocm/fakes/ocm.go
max-same-issues: 0
max-issues-per-linter: 0
exclude-rules:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ GOLANGCI_LINT ?= $(LOCALBIN)/golangci-lint
## Tool Versions
KUSTOMIZE_VERSION ?= v3.8.7
CONTROLLER_TOOLS_VERSION ?= v0.11.1
GOLANGCI_LINT_VERSION ?= v1.55.2
GOLANGCI_LINT_VERSION ?= v1.57.2

KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"
.PHONY: kustomize
Expand Down
7 changes: 2 additions & 5 deletions controllers/productdeployment_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,9 @@ func (r *ProductDeploymentReconciler) reconcile(ctx context.Context, obj *v1alph

obj.Status.ActivePipelines = nil
for _, ep := range existingPipelines.Items {
ep := ep
alreadyCreatedPipelines[ep.Name] = struct{}{}

if !conditions.IsTrue(&ep, meta.ReadyCondition) {
if !conditions.IsTrue(&ep, meta.ReadyCondition) { //nolint: gosec // it's 1.22
obj.Status.ActivePipelines = append(obj.Status.ActivePipelines, ep.Name)
}
}
Expand Down Expand Up @@ -405,9 +404,7 @@ func (r *ProductDeploymentReconciler) generateConfigMap(ctx context.Context, obj
// garbage collect old configmaps
var errf error
for _, cm := range existingMaps.Items {
cm := cm
err := r.Client.Delete(ctx, &cm)
if err != nil {
if err := r.Client.Delete(ctx, &cm); err != nil { //nolint:gosec // go 1.22
errf = errors.Join(errf, err)
}
}
Expand Down
6 changes: 3 additions & 3 deletions controllers/productdeploymentgenerator_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ const (
`
componentVersionAnnotationKey = "mpas.ocm.system/component-version"
componentNameAnnotationKey = "mpas.ocm.system/component-name"
ignoreMarker = "+mpas-ignore"
)

const (
Expand Down Expand Up @@ -406,6 +405,7 @@ func (r *ProductDeploymentGeneratorReconciler) createSync(
Message: project.Spec.Git.CommitTemplate.Message,
BaseBranch: project.Spec.Git.DefaultBranch,
},

PullRequestTemplate: gitv1alpha1.PullRequestTemplate{
Title: fmt.Sprintf("MPAS System Automated Pull Request for Product: %s", prodDesc.Name),
},
Expand Down Expand Up @@ -582,9 +582,9 @@ func (r *ProductDeploymentGeneratorReconciler) createProductPipeline(

// if the list is empty, select one from the available targets.
for _, role := range description.Spec.TargetRoles {
role := role
if role.Name == p.TargetRoleName {
targetRole = &role.TargetRole
t := role.TargetRole
targetRole = &t

break
}
Expand Down

0 comments on commit c4f3f5e

Please sign in to comment.