Skip to content

Commit

Permalink
update ci lint
Browse files Browse the repository at this point in the history
  • Loading branch information
youyuanwu committed Jul 22, 2023
1 parent f10ee8a commit 72fddbe
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yaml
Expand Up @@ -41,6 +41,7 @@ jobs:

steps:
- uses: actions/checkout@v2
- uses: golangci/golangci-lint-action@v2
- uses: golangci/golangci-lint-action@v3
with:
version: v1.53
args: --timeout=5m
2 changes: 2 additions & 0 deletions .golangci.yml
Expand Up @@ -43,6 +43,8 @@ linters:
# TODO: review the linters below. We disabled them to make the CI pass first.
- nonamedreturns
- exhaustruct
- nosnakecase
- nolintlint
- ireturn
- varnamelen
- forcetypeassert
Expand Down
3 changes: 2 additions & 1 deletion default_validator.go
Expand Up @@ -170,7 +170,7 @@ func (d *defaultValidator) validateDefaultInResponse(resp *spec.Response, respon

responseName, responseCodeAsStr := responseHelp.responseMsgVariants(responseType, responseCode)

// nolint: dupl
//nolint: dupl
if response.Headers != nil { // Safeguard
for nm, h := range response.Headers {
// reset explored schemas to get depth-first recursive-proof exploration
Expand Down Expand Up @@ -262,6 +262,7 @@ func (d *defaultValidator) validateDefaultValueSchemaAgainstSchema(path, in stri
}

// TODO: Temporary duplicated code. Need to refactor with examples

// nolint: dupl
func (d *defaultValidator) validateDefaultValueItemsAgainstSchema(path, in string, root interface{}, items *spec.Items) *Result {
res := new(Result)
Expand Down
2 changes: 1 addition & 1 deletion helpers.go
Expand Up @@ -250,7 +250,7 @@ func (h *paramHelper) resolveParam(path, method, operationID string, param *spec

}
if err != nil { // Safeguard
// NOTE: we may enter enter here when the whole parameter is an unresolved $ref
// NOTE: we may enter here when the whole parameter is an unresolved $ref

Check warning on line 253 in helpers.go

View check run for this annotation

Codecov / codecov/patch

helpers.go#L253

Added line #L253 was not covered by tests
refPath := strings.Join([]string{"\"" + path + "\"", method}, ".")
errorHelp.addPointerError(res, err, param.Ref.String(), refPath)
return nil, res
Expand Down

0 comments on commit 72fddbe

Please sign in to comment.