Skip to content

Commit

Permalink
Fix the golangci-lint path checks
Browse files Browse the repository at this point in the history
  • Loading branch information
mszostok committed Nov 1, 2019
1 parent 0560dac commit c2ba39c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
2 changes: 1 addition & 1 deletion hack/ci/run-lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ golangci::run_checks() {

ENABLE=$(sed 's/ /,/g' <<< "${LINTS[@]}")

golangci-lint --disable-all --enable="${ENABLE}" run ./pkg/... ./cmd/... .
golangci-lint --disable-all --enable="${ENABLE}" run

echo -e "${GREEN}√ run golangci-lint${NC}"
}
Expand Down
8 changes: 4 additions & 4 deletions internal/check/valid_owner.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,11 @@ func (v *ValidOwnerChecker) validateTeam(ctx context.Context, name string) *vali
if err.Response.StatusCode == http.StatusUnauthorized {
return &validateError{fmt.Sprintf("Team %q could not be check. Requires GitHub authorization.", name), Warning, false}
}
return &validateError{fmt.Sprintf("HTTP error occured while calling GitHub: %v", err), Error, false}
return &validateError{fmt.Sprintf("HTTP error occurred while calling GitHub: %v", err), Error, false}
case *github.RateLimitError:
return &validateError{fmt.Sprintf("GitHub rate limit reached: %v", err.Message), Warning, true}
default:
return &validateError{fmt.Sprintf("Unknown error occured while calling GitHub: %v", err), Error, false}
return &validateError{fmt.Sprintf("Unknown error occurred while calling GitHub: %v", err), Error, false}
}
}

Expand Down Expand Up @@ -144,11 +144,11 @@ func (v *ValidOwnerChecker) validateGithubUser(ctx context.Context, name string)
if err.Response.StatusCode == http.StatusNotFound {
return &validateError{fmt.Sprintf("User %q does not have github account", name), Error, false}
}
return &validateError{fmt.Sprintf("HTTP error occured while calling GitHub: %v", err), Error, false}
return &validateError{fmt.Sprintf("HTTP error occurred while calling GitHub: %v", err), Error, false}
case *github.RateLimitError:
return &validateError{fmt.Sprintf("GitHub rate limit reached: %v", err.Message), Warning, true}
default:
return &validateError{fmt.Sprintf("Unknown error occured while calling GitHub: %v", err), Error, false}
return &validateError{fmt.Sprintf("Unknown error occurred while calling GitHub: %v", err), Error, false}
}
}

Expand Down
8 changes: 2 additions & 6 deletions internal/runner/runner_worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,12 @@ func (r *CheckRunner) ShouldExitWithCheckFailure() bool {
}
}

if higherOccurredIssue <= r.treatedAsFailure {
return true
}

return false
return higherOccurredIssue <= r.treatedAsFailure
}

func (r *CheckRunner) collectMetrics(checkOut check.Output) {
for _, i := range checkOut.Issues {
r.allFoundIssues[i.Severity] += 1
r.allFoundIssues[i.Severity]++
}

if len(checkOut.Issues) > 0 {
Expand Down

0 comments on commit c2ba39c

Please sign in to comment.