diff --git a/.golangci.yml b/.golangci.yml index a699bcb7..d34c9825 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -180,3 +180,5 @@ linters-settings: require-explanation: false # Enable to require nolint directives to mention the specific linter being suppressed. Default is false. require-specific: true + goconst: + min-occurrences: 5 diff --git a/go.mod b/go.mod index 49808f1c..1c9710d6 100644 --- a/go.mod +++ b/go.mod @@ -20,7 +20,7 @@ require ( golang.org/x/term v0.13.0 golang.org/x/tools/go/vcs v0.1.0-deprecated gopkg.in/yaml.v2 v2.4.0 - sigs.k8s.io/release-utils v0.7.5 + sigs.k8s.io/release-utils v0.7.6 ) require ( diff --git a/go.sum b/go.sum index 83aa2668..046fa017 100644 --- a/go.sum +++ b/go.sum @@ -214,5 +214,5 @@ modernc.org/memory v1.5.0 h1:N+/8c5rE6EqugZwHii4IFsaJ7MUhoWX07J5tC/iI5Ds= modernc.org/memory v1.5.0/go.mod h1:PkUhL0Mugw21sHPeskwZW4D6VscE/GQJOnIpCnW6pSU= modernc.org/sqlite v1.23.1 h1:nrSBg4aRQQwq59JpvGEQ15tNxoO5pX/kUjcRNwSAGQM= modernc.org/sqlite v1.23.1/go.mod h1:OrDj17Mggn6MhE+iPbBNf7RGKODDE9NFT0f3EwDzJqk= -sigs.k8s.io/release-utils v0.7.5 h1:0DYUWILqT0rirJ+8Vrp+Fr8jG8Q32ejFnulkahOvEao= -sigs.k8s.io/release-utils v0.7.5/go.mod h1:GZGWmbINwsLGKsoZKTeWUGp4F+Rbwhq4XDtJ45N+dLw= +sigs.k8s.io/release-utils v0.7.6 h1:mQxQRAIulbyz6y7eOCzklAelcpYjBj8MMGFcxNnyqto= +sigs.k8s.io/release-utils v0.7.6/go.mod h1:GZGWmbINwsLGKsoZKTeWUGp4F+Rbwhq4XDtJ45N+dLw= diff --git a/magefile.go b/magefile.go index b9aefbd0..914fb895 100644 --- a/magefile.go +++ b/magefile.go @@ -90,7 +90,7 @@ func Verify() error { } fmt.Println("Running go module linter...") - if err := mage.VerifyGoMod(scriptDir); err != nil { + if err := mage.VerifyGoMod(); err != nil { return err } diff --git a/pkg/query/filter_test.go b/pkg/query/filter_test.go index 64e61310..fe5a9d0d 100644 --- a/pkg/query/filter_test.go +++ b/pkg/query/filter_test.go @@ -30,10 +30,10 @@ func testPackages() map[string]*spdx.Package { p := spdx.NewPackage() p.ID = s p.Name = fmt.Sprintf("gcr.io/puerco-chainguard/images/%s:v9.0.2-buster", s) - dg := "sha256:4ed64c2e0857ad21c38b98345ebb5edb01791a0a10b0e9e3d9ddde185cdbd31a" //nolint: gosec + dg := "sha256:4ed64c2e0857ad21c38b98345ebb5edb01791a0a10b0e9e3d9ddde185cdbd31a" repo := "index.docker.io%2Flibrary" if i == 1 { - dg = "sha256:c0d8e30ad4f13b5f26794264fe057c488c72a5112978b1c24f3940dfaf69368a" //nolint: gosec + dg = "sha256:c0d8e30ad4f13b5f26794264fe057c488c72a5112978b1c24f3940dfaf69368a" repo = "gcr.io%2Fproject" } p.ExternalRefs = []spdx.ExternalRef{ diff --git a/pkg/spdx/spdx_unit_test.go b/pkg/spdx/spdx_unit_test.go index ef9ee5cf..c4fb0ea3 100644 --- a/pkg/spdx/spdx_unit_test.go +++ b/pkg/spdx/spdx_unit_test.go @@ -299,7 +299,7 @@ func TestGetImageReferences(t *testing.T) { } // Test a sha reference. This is the linux/ppc64le image - singleRef := "registry.k8s.io/kube-apiserver@sha256:1a61b61491042e2b1e659c4d57d426d01d9467fb381404bff029be4d00ead519" //nolint: gosec + singleRef := "registry.k8s.io/kube-apiserver@sha256:1a61b61491042e2b1e659c4d57d426d01d9467fb381404bff029be4d00ead519" references, err = getImageReferences(singleRef) require.NoError(t, err) require.Len(t, references.Images, 0)