Skip to content

Commit

Permalink
other round linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
renzodavid9 committed May 20, 2024
1 parent e3540fd commit 2200ea4
Show file tree
Hide file tree
Showing 10 changed files with 174 additions and 269 deletions.
2 changes: 1 addition & 1 deletion pkg/artifacts/signable_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ const (
var ignore = []cmp.Option{cmpopts.IgnoreUnexported(name.Registry{}, name.Repository{}, name.Digest{})}

func TestOCIArtifact_ExtractObjects(t *testing.T) {

tests := []struct {
name string
obj objects.TektonObject
Expand Down Expand Up @@ -808,6 +807,7 @@ func TestExtractBuildArtifactsFromResults(t *testing.T) {
}

func createDigest(t *testing.T, dgst string) name.Digest {
t.Helper()
result, err := name.NewDigest(dgst)
if err != nil {
t.Fatal(err)
Expand Down
4 changes: 2 additions & 2 deletions pkg/chains/formats/slsa/internal/metadata/metadata_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
)

func TestMetadata(t *testing.T) {
tr := &v1.TaskRun{ //nolint:staticcheck
tr := &v1.TaskRun{
ObjectMeta: metav1.ObjectMeta{
Name: "my-taskrun",
Namespace: "my-namespace",
Expand Down Expand Up @@ -58,7 +58,7 @@ func TestMetadata(t *testing.T) {

func TestMetadataInTimeZone(t *testing.T) {
tz := time.FixedZone("Test Time", int((12 * time.Hour).Seconds()))
tr := &v1.TaskRun{ //nolint:staticcheck
tr := &v1.TaskRun{
ObjectMeta: metav1.ObjectMeta{
Name: "my-taskrun",
Namespace: "my-namespace",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const (

// used to toggle the fields in see AddTektonTaskDescriptor
// and AddSLSATaskDescriptor
type addTaskDescriptorContent func(*objects.TaskRunObjectV1) (*intoto.ResourceDescriptor, error) //nolint:staticcheck
type addTaskDescriptorContent func(*objects.TaskRunObjectV1) (*intoto.ResourceDescriptor, error)

// ResolveOptions represents the configuration to be use to resolve dependencies.
type ResolveOptions struct {
Expand Down Expand Up @@ -111,7 +111,7 @@ func RemoveDuplicateResolvedDependencies(resolvedDependencies []*intoto.Resource

// AddTektonTaskDescriptor returns the more verbose resolved dependency content. this adds the name, uri, digest
// and content if possible.
func AddTektonTaskDescriptor(tr *objects.TaskRunObjectV1) (*intoto.ResourceDescriptor, error) { //nolint:staticcheck
func AddTektonTaskDescriptor(tr *objects.TaskRunObjectV1) (*intoto.ResourceDescriptor, error) {
rd := intoto.ResourceDescriptor{}
storedTr, err := json.Marshal(tr)
if err != nil {
Expand All @@ -130,7 +130,7 @@ func AddTektonTaskDescriptor(tr *objects.TaskRunObjectV1) (*intoto.ResourceDescr

// AddSLSATaskDescriptor resolves dependency content for the more generic slsa verifiers. just logs
// the name, uri and digest.
func AddSLSATaskDescriptor(tr *objects.TaskRunObjectV1) (*intoto.ResourceDescriptor, error) { //nolint:staticcheck
func AddSLSATaskDescriptor(tr *objects.TaskRunObjectV1) (*intoto.ResourceDescriptor, error) {
if tr.Status.Provenance != nil && tr.Status.Provenance.RefSource != nil {
return &intoto.ResourceDescriptor{
Name: PipelineTaskConfigName,
Expand Down
Loading

0 comments on commit 2200ea4

Please sign in to comment.