mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2026-04-15 01:41:56 +00:00
Enable some linters (#3129)
Mostly those that did not require much work. From #2960 --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
@@ -61,11 +61,11 @@ func parseHook(r *http.Request, merge bool) (*github.PullRequest, *model.Repo, *
|
||||
|
||||
switch hook := payload.(type) {
|
||||
case *github.PushEvent:
|
||||
repo, pipeline, err := parsePushHook(hook)
|
||||
return nil, repo, pipeline, err
|
||||
repo, pipeline := parsePushHook(hook)
|
||||
return nil, repo, pipeline, nil
|
||||
case *github.DeploymentEvent:
|
||||
repo, pipeline, err := parseDeployHook(hook)
|
||||
return nil, repo, pipeline, err
|
||||
repo, pipeline := parseDeployHook(hook)
|
||||
return nil, repo, pipeline, nil
|
||||
case *github.PullRequestEvent:
|
||||
return parsePullHook(hook, merge)
|
||||
default:
|
||||
@@ -75,9 +75,9 @@ func parseHook(r *http.Request, merge bool) (*github.PullRequest, *model.Repo, *
|
||||
|
||||
// parsePushHook parses a push hook and returns the Repo and Pipeline details.
|
||||
// If the commit type is unsupported nil values are returned.
|
||||
func parsePushHook(hook *github.PushEvent) (*model.Repo, *model.Pipeline, error) {
|
||||
func parsePushHook(hook *github.PushEvent) (*model.Repo, *model.Pipeline) {
|
||||
if hook.Deleted != nil && *hook.Deleted {
|
||||
return nil, nil, nil
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
pipeline := &model.Pipeline{
|
||||
@@ -110,12 +110,12 @@ func parsePushHook(hook *github.PushEvent) (*model.Repo, *model.Pipeline, error)
|
||||
}
|
||||
}
|
||||
|
||||
return convertRepoHook(hook.GetRepo()), pipeline, nil
|
||||
return convertRepoHook(hook.GetRepo()), pipeline
|
||||
}
|
||||
|
||||
// parseDeployHook parses a deployment and returns the Repo and Pipeline details.
|
||||
// If the commit type is unsupported nil values are returned.
|
||||
func parseDeployHook(hook *github.DeploymentEvent) (*model.Repo, *model.Pipeline, error) {
|
||||
func parseDeployHook(hook *github.DeploymentEvent) (*model.Repo, *model.Pipeline) {
|
||||
pipeline := &model.Pipeline{
|
||||
Event: model.EventDeploy,
|
||||
Commit: hook.GetDeployment().GetSHA(),
|
||||
@@ -138,7 +138,7 @@ func parseDeployHook(hook *github.DeploymentEvent) (*model.Repo, *model.Pipeline
|
||||
pipeline.Ref = fmt.Sprintf("refs/heads/%s", pipeline.Branch)
|
||||
}
|
||||
|
||||
return convertRepo(hook.GetRepo()), pipeline, nil
|
||||
return convertRepo(hook.GetRepo()), pipeline
|
||||
}
|
||||
|
||||
// parsePullHook parses a pull request hook and returns the Repo and Pipeline
|
||||
|
||||
Reference in New Issue
Block a user