Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
130 changes: 75 additions & 55 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -1,59 +1,79 @@
version: "2"
run:
# Default timeout is 1m, up to give more room
# Default timeout is 0 (no limit), have an upper limit
timeout: 4m

linters:
enable:
- asciicheck
- unused
- depguard
- gofumpt
- goimports
- importas
- revive
- misspell
- stylecheck
- tparallel
- unconvert
- unparam
- whitespace

linters-settings:
importas:
alias:
- pkg: k8s.io/api/core/v1
alias: corev1
- pkg: k8s.io/apimachinery/pkg/apis/meta/v1
alias: metav1
- pkg: k8s.io/apimachinery/pkg/api/errors
alias: apierrors
- pkg: github.com/operator-framework/api/pkg/operators/v1alpha1
alias: operatorsv1alpha1
- pkg: github.com/operator-framework/api/pkg/operators/v1
alias: operatorsv1
- pkg: github.com/openshift/api/image/v1
alias: imagestreamv1
revive:
rules:
- name: dot-imports
severity: warning
disabled: true
stylecheck:
dot-import-whitelist:
- github.com/onsi/gomega
- github.com/onsi/ginkgo
- github.com/onsi/ginkgo/v2
goimports:
local-prefixes: github.com/redhat-certification/chart-verifier
depguard:
rules:
main:
list-mode: lax
files:
- !$test
allow:
- $gostd

output:
formats:
- format: tab
tab:
path: stdout
colors: false
linters:
enable:
- asciicheck
- depguard
- importas
- misspell
- revive
- staticcheck
- tparallel
- unconvert
- unparam
- whitespace
settings:
depguard:
rules:
main:
list-mode: lax
files:
- ""
allow:
- $gostd
importas:
alias:
- pkg: k8s.io/api/core/v1
alias: corev1
- pkg: k8s.io/apimachinery/pkg/apis/meta/v1
alias: metav1
- pkg: k8s.io/apimachinery/pkg/api/errors
alias: apierrors
- pkg: github.com/operator-framework/api/pkg/operators/v1alpha1
alias: operatorsv1alpha1
- pkg: github.com/operator-framework/api/pkg/operators/v1
alias: operatorsv1
- pkg: github.com/openshift/api/image/v1
alias: imagestreamv1
revive:
rules:
- name: dot-imports
severity: warning
disabled: true
staticcheck:
dot-import-whitelist:
- github.com/onsi/gomega
- github.com/onsi/ginkgo
- github.com/onsi/ginkgo/v2
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
paths:
- third_party$
- builtin$
- examples$
formatters:
enable:
- gofumpt
- goimports
settings:
goimports:
local-prefixes:
- github.com/redhat-certification/chart-verifier
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM docker.io/golang:1.23 as build
FROM docker.io/golang:1.24 as build

WORKDIR /tmp/src

Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,10 @@ install.gofumpt:

# golangci-lint
GOLANGCI_LINT = $(shell pwd)/out/golangci-lint
GOLANGCI_LINT_VERSION ?= v1.63.4
GOLANGCI_LINT_VERSION ?= v2.2.1
install.golangci-lint: $(GOLANGCI_LINT)
$(GOLANGCI_LINT):
$(call go-install-tool,$(GOLANGCI_LINT),github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION))\
$(call go-install-tool,$(GOLANGCI_LINT),github.com/golangci/golangci-lint/v2/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION))\

# go-install-tool will 'go install' any package $2 and install it to $1.
PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/redhat-certification/chart-verifier

go 1.23.5
go 1.24.5

require (
dario.cat/mergo v1.0.1
Expand Down
3 changes: 1 addition & 2 deletions internal/chartverifier/profiles/profile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ import (
const (
NoVersion string = ""
configVersion00 string = "v0.0"
//nolint:deadcode // TODO(komish) identify where this was intended to be used, or remove.
// This should be unused but its triggering as deadcode which is replaced by the unused linter.
// TODO(komish) identify where this was intended to be used, or remove.
configVersion10 string = "v1.0"
configVersion11 string = "v1.1"
configVersion12 string = "v1.2"
Expand Down
2 changes: 1 addition & 1 deletion internal/chartverifier/pyxis/pyxis.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ Loops:
// when working with certified images or internal registries. Better to deal with this
// by itself at a future date than introduce a potentially subtle bug.
//
//nolint:stylecheck
//nolint:staticcheck // ST1005
err = fmt.Errorf("No images found for Registry/Repository: %s/%s", registry, imageRef.Repository)
}
} else {
Expand Down
2 changes: 1 addition & 1 deletion internal/chartverifier/verifier_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import (
func isOk(c *apiReport.Report) bool {
outcome := true
for _, check := range c.Results {
if !(check.Outcome == apiReport.PassOutcomeType) {
if check.Outcome != apiReport.PassOutcomeType {
outcome = false
break
}
Expand Down
2 changes: 1 addition & 1 deletion internal/helm/actions/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func RenderManifests(name string, url string, vals map[string]interface{}, conf
}
client.ReleaseName = name

cp, err := client.ChartPathOptions.LocateChart(chart, cli.New())
cp, err := client.LocateChart(chart, cli.New())
if err != nil {
return emptyResponse, err
}
Expand Down
4 changes: 2 additions & 2 deletions internal/tool/helm.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func (h Helm) Install(ctx context.Context, namespace, chart, release, valuesFile
// ref: https://helm.sh/docs/helm/helm_install
client.Timeout = h.timeout

cp, err := client.ChartPathOptions.LocateChart(chart, h.envSettings)
cp, err := client.LocateChart(chart, h.envSettings)
if err != nil {
utils.LogError(fmt.Sprintf("Error LocateChart: %v", err))
return err
Expand Down Expand Up @@ -148,7 +148,7 @@ func (h Helm) Upgrade(ctx context.Context, namespace, chart, release string) err
client.ReuseValues = true
client.Wait = true

cp, err := client.ChartPathOptions.LocateChart(chart, h.envSettings)
cp, err := client.LocateChart(chart, h.envSettings)
if err != nil {
utils.LogError(fmt.Sprintf("Error LocateChart: %v", err))
return err
Expand Down
2 changes: 1 addition & 1 deletion internal/tool/pgp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func TestDigest2(t *testing.T) {
base64KeyFromCmd, _ := base64Cmd.Output()

base64Key := strings.Trim(string(base64KeyFromCmd), " -\n")
base64Key = strings.Replace(base64Key, "\n", "", -1)
base64Key = strings.ReplaceAll(base64Key, "\n", "")

encodedKey, encodeErr := GetEncodedKey(keyfileName)
require.NoError(t, encodeErr)
Expand Down
2 changes: 1 addition & 1 deletion pkg/chartverifier/reportsummary/reportSummary.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const (
SkipDigestCheck BooleanKey = "skipDigestCheck"
)

//nolint:deadcode,unused // Note(komish) need to ensure this isn't used, and research
//nolint:unused // Note(komish) need to ensure this isn't used, and research
var setBooleanKeys = [...]BooleanKey{SkipDigestCheck}

type APIReportSummary interface {
Expand Down