mirror of https://github.com/harness/drone.git
techdebt: fix latest linting issues (#806)
parent
298e509ea1
commit
ab9089d613
|
@ -42,8 +42,5 @@ func (p *WriteParams) Validate() error {
|
||||||
return errors.InvalidArgument("RepoUID is mandatory field")
|
return errors.InvalidArgument("RepoUID is mandatory field")
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := p.Actor.Validate(); err != nil {
|
return p.Actor.Validate()
|
||||||
return err
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,11 +49,7 @@ func (p DiffParams) Validate() error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Service) RawDiff(ctx context.Context, params *DiffParams, out io.Writer) error {
|
func (s *Service) RawDiff(ctx context.Context, params *DiffParams, out io.Writer) error {
|
||||||
if err := s.rawDiff(ctx, params, out); err != nil {
|
return s.rawDiff(ctx, params, out)
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Service) rawDiff(ctx context.Context, params *DiffParams, w io.Writer) error {
|
func (s *Service) rawDiff(ctx context.Context, params *DiffParams, w io.Writer) error {
|
||||||
|
|
|
@ -21,7 +21,7 @@ import (
|
||||||
|
|
||||||
const (
|
const (
|
||||||
EnvActorName = "GITNESS_HOOK_ACTOR_NAME"
|
EnvActorName = "GITNESS_HOOK_ACTOR_NAME"
|
||||||
EnvActorEmail = "GITNESS_HOOK_ACTOR_EMAIL"
|
EnvActorEmail = "GITNESS_HOOK_ACTOR_EMAIL" //#nosec
|
||||||
EnvRepoUID = "GITNESS_HOOK_REPO_UID"
|
EnvRepoUID = "GITNESS_HOOK_REPO_UID"
|
||||||
EnvRequestID = "GITNESS_HOOK_REQUEST_ID"
|
EnvRequestID = "GITNESS_HOOK_REQUEST_ID"
|
||||||
)
|
)
|
||||||
|
|
|
@ -83,11 +83,7 @@ type CommitFilesParams struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *CommitFilesParams) Validate() error {
|
func (p *CommitFilesParams) Validate() error {
|
||||||
if err := p.WriteParams.Validate(); err != nil {
|
return p.WriteParams.Validate()
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type CommitFilesResponse struct {
|
type CommitFilesResponse struct {
|
||||||
|
|
16
git/repo.go
16
git/repo.go
|
@ -83,10 +83,7 @@ type CreateRepositoryParams struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *CreateRepositoryParams) Validate() error {
|
func (p *CreateRepositoryParams) Validate() error {
|
||||||
if err := p.Actor.Validate(); err != nil {
|
return p.Actor.Validate()
|
||||||
return err
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type CreateRepositoryOutput struct {
|
type CreateRepositoryOutput struct {
|
||||||
|
@ -118,10 +115,7 @@ type HashRepositoryParams struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *HashRepositoryParams) Validate() error {
|
func (p *HashRepositoryParams) Validate() error {
|
||||||
if err := p.ReadParams.Validate(); err != nil {
|
return p.ReadParams.Validate()
|
||||||
return err
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type HashRepositoryOutput struct {
|
type HashRepositoryOutput struct {
|
||||||
|
@ -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)
|
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 s.DeleteRepositoryBestEffort(ctx, params.RepoUID)
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Service) DeleteRepositoryBestEffort(ctx context.Context, repoUID string) error {
|
func (s *Service) DeleteRepositoryBestEffort(ctx context.Context, repoUID string) error {
|
||||||
|
|
Loading…
Reference in New Issue