Skip to content

Commit

Permalink
tools(i): Enable nilness linter (#2383)
Browse files Browse the repository at this point in the history
## Relevant issue(s)

Resolves #2382 

## Description

This PR enables the `nilness` linter and fixes a few issues caught by
it.

## Tasks

- [x] I made sure the code is well commented, particularly
hard-to-understand areas.
- [x] I made sure the repository-held documentation is changed
accordingly.
- [x] I made sure the pull request title adheres to the conventional
commit style (the subset used in the project can be found in
[tools/configs/chglog/config.yml](tools/configs/chglog/config.yml)).
- [x] I made sure to discuss its limitations such as threats to
validity, vulnerability to mistake and misuse, robustness to
invalidation of assumptions, resource requirements, ...

## How has this been tested?

`make lint`

Specify the platform(s) on which this was tested:
- MacOS
  • Loading branch information
nasdf authored Mar 6, 2024
1 parent fb3ce47 commit 76d8735
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
4 changes: 0 additions & 4 deletions http/handler_lens.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,6 @@ func (s *lensHandler) MigrateDown(rw http.ResponseWriter, req *http.Request) {
responseJSON(rw, http.StatusBadRequest, errorResponse{err})
return
}
if err != nil {
responseJSON(rw, http.StatusBadRequest, errorResponse{err})
return
}
var value []map[string]any
err = enumerable.ForEach(result, func(item map[string]any) {
value = append(value, item)
Expand Down
2 changes: 1 addition & 1 deletion request/graphql/parser/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func ParseRequest(schema gql.Schema, doc *ast.Document) (*request.Request, []err
}

parsedDirectives, err := parseDirectives(astOpDef.Directives)
if errs != nil {
if err != nil {
return nil, []error{err}
}
parsedQueryOpDef.Directives = parsedDirectives
Expand Down
1 change: 1 addition & 0 deletions tools/configs/golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ linters-settings:
# run `go tool vet help` to see all analyzers
enable:
- atomicalign
- nilness

enable-all: false

Expand Down

0 comments on commit 76d8735

Please sign in to comment.