Skip to content

Commit

Permalink
techdebt: fix latest linting issues (harness#806)
Browse files Browse the repository at this point in the history
  • Loading branch information
akhilpandey1 authored and Harness committed Nov 16, 2023
1 parent 298e509 commit ab9089d
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 28 deletions.
5 changes: 1 addition & 4 deletions git/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,5 @@ func (p *WriteParams) Validate() error {
return errors.InvalidArgument("RepoUID is mandatory field")
}

if err := p.Actor.Validate(); err != nil {
return err
}
return nil
return p.Actor.Validate()
}
6 changes: 1 addition & 5 deletions git/diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,7 @@ func (p DiffParams) Validate() error {
}

func (s *Service) RawDiff(ctx context.Context, params *DiffParams, out io.Writer) error {
if err := s.rawDiff(ctx, params, out); err != nil {
return err
}

return nil
return s.rawDiff(ctx, params, out)
}

func (s *Service) rawDiff(ctx context.Context, params *DiffParams, w io.Writer) error {
Expand Down
2 changes: 1 addition & 1 deletion git/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (

const (
EnvActorName = "GITNESS_HOOK_ACTOR_NAME"
EnvActorEmail = "GITNESS_HOOK_ACTOR_EMAIL"
EnvActorEmail = "GITNESS_HOOK_ACTOR_EMAIL" //#nosec
EnvRepoUID = "GITNESS_HOOK_REPO_UID"
EnvRequestID = "GITNESS_HOOK_REQUEST_ID"
)
Expand Down
6 changes: 1 addition & 5 deletions git/operations.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,7 @@ type CommitFilesParams struct {
}

func (p *CommitFilesParams) Validate() error {
if err := p.WriteParams.Validate(); err != nil {
return err
}

return nil
return p.WriteParams.Validate()
}

type CommitFilesResponse struct {
Expand Down
16 changes: 3 additions & 13 deletions git/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,7 @@ type CreateRepositoryParams struct {
}

func (p *CreateRepositoryParams) Validate() error {
if err := p.Actor.Validate(); err != nil {
return err
}
return nil
return p.Actor.Validate()
}

type CreateRepositoryOutput struct {
Expand Down Expand Up @@ -118,10 +115,7 @@ type HashRepositoryParams struct {
}

func (p *HashRepositoryParams) Validate() error {
if err := p.ReadParams.Validate(); err != nil {
return err
}
return nil
return p.ReadParams.Validate()
}

type HashRepositoryOutput struct {
Expand Down Expand Up @@ -204,11 +198,7 @@ func (s *Service) DeleteRepository(ctx context.Context, params *DeleteRepository
return fmt.Errorf("failed to check the status of the repository %v: %w", repoPath, err)
}

if err := s.DeleteRepositoryBestEffort(ctx, params.RepoUID); err != nil {
return err
}

return nil
return s.DeleteRepositoryBestEffort(ctx, params.RepoUID)
}

func (s *Service) DeleteRepositoryBestEffort(ctx context.Context, repoUID string) error {
Expand Down

0 comments on commit ab9089d

Please sign in to comment.