Skip to content

Commit

Permalink
Update linters configuration (#4277)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlekSi committed May 8, 2024
1 parent dcdfe47 commit fb4f384
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .golangci-new.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ linters:
- dogsled
- dupl
- durationcheck
- err113
- errchkjson
- errname
- execinquery
Expand All @@ -111,7 +112,6 @@ linters:
- gocognit
- gocritic
- gocyclo
- goerr113
- gofmt
- gofumpt
- gomnd
Expand Down
3 changes: 2 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,8 @@ linters-settings:
no-mixed-args: true
kv-only: false
attr-only: true
context-only: false # https://github.com/go-simpler/sloglint/issues/29
no-global: "all"
context: "scope"
static-msg: false # TODO https://github.com/FerretDB/FerretDB/issues/3421
no-raw-keys: false # TODO https://github.com/FerretDB/FerretDB/issues/3421
key-naming-case: snake
Expand Down
6 changes: 1 addition & 5 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -476,11 +476,7 @@ tasks:
- bin/envtool{{exeExt}} shell mkdir tmp/githubcache
- bin/golangci-lint{{exeExt}} run --config=.golangci.yml
- bin/golangci-lint{{exeExt}} run --config=.golangci-new.yml

# Stop CI from failing too often; see https://github.com/quasilyte/go-consistent/issues/38.
# Still, note the output and fix the issues.
- cmd: bin/go-consistent{{exeExt}} -pedantic ./cmd/... ./internal/... ./build/... ./ferretdb/...
ignore_error: true
- bin/go-consistent{{exeExt}} -pedantic ./cmd/... ./internal/... ./build/... ./ferretdb/...

- go vet -vettool=bin/checkswitch{{exeExt}} ./...
- go vet -vettool=bin/checkcomments{{exeExt}} ./...
Expand Down
2 changes: 1 addition & 1 deletion integration/.golangci-new.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ linters:
- dogsled
- dupl
- durationcheck
- err113
- errchkjson
- errname
- execinquery
Expand All @@ -104,7 +105,6 @@ linters:
- gocognit
- gocritic
- gocyclo
- goerr113
- gofmt
- gofumpt
- gomnd
Expand Down
3 changes: 2 additions & 1 deletion integration/.golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ linters-settings:
no-mixed-args: true
kv-only: false
attr-only: true
context-only: true
no-global: "all"
context: "scope"
static-msg: true
no-raw-keys: false # TODO https://github.com/FerretDB/FerretDB/issues/3421
key-naming-case: snake
Expand Down
6 changes: 1 addition & 5 deletions integration/Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,7 @@ tasks:
cmds:
- ../bin/golangci-lint{{exeExt}} run --config=.golangci.yml
- ../bin/golangci-lint{{exeExt}} run --config=.golangci-new.yml

# Stop CI from failing too often; see https://github.com/quasilyte/go-consistent/issues/38.
# Still, note the output and fix the issues.
- cmd: ../bin/go-consistent{{exeExt}} -pedantic ./...
ignore_error: true
- ../bin/go-consistent{{exeExt}} -pedantic ./...

- go vet -vettool=../bin/checkswitch{{exeExt}} ./...
- go vet -vettool=../bin/checkcomments{{exeExt}} ./...
Expand Down
3 changes: 2 additions & 1 deletion internal/driver/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,8 @@ func (c *Conn) Request(ctx context.Context, header *wire.MsgHeader, body wire.Ms
}

if resHeader.ResponseTo != header.RequestID {
c.l.Error(
c.l.ErrorContext(
ctx,
"response_to is not equal to request_id",
slog.Int("request_id", int(header.RequestID)),
slog.Int("response_id", int(resHeader.RequestID)),
Expand Down
6 changes: 1 addition & 5 deletions tools/Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,7 @@ tasks:
cmds:
- ../bin/golangci-lint{{exeExt}} run --config=../.golangci.yml ./checkcomments/... ./checkdocs/... ./checkswitch/...
- ../bin/golangci-lint{{exeExt}} run --config=../.golangci-new.yml ./checkcomments/... ./checkdocs/... ./checkswitch/...

# Stop CI from failing too often; see https://github.com/quasilyte/go-consistent/issues/38.
# Still, note the output and fix the issues.
- cmd: ../bin/go-consistent{{exeExt}} -pedantic ./checkcomments/... ./checkdocs/... ./checkswitch/...
ignore_error: true
- ../bin/go-consistent{{exeExt}} -pedantic ./checkcomments/... ./checkdocs/... ./checkswitch/...

- go vet -vettool=../bin/checkswitch{{exeExt}} ./checkcomments/... ./checkdocs/... ./checkswitch/...
- go vet -vettool=../bin/checkcomments{{exeExt}} ./checkcomments/... ./checkdocs/... ./checkswitch/...

0 comments on commit fb4f384

Please sign in to comment.