Skip to content

Commit

Permalink
Update golangci-lint to v1.59.1
Browse files Browse the repository at this point in the history
Also fixes the configuration file to remove deprecated options and/or
to use new format.

Finally, run `goimports` on `jetstream_sourcing_scaling_test.go` to
satisfy the linter.

Signed-off-by: Neil Twigg <[email protected]>
  • Loading branch information
neilalexander committed Aug 7, 2024
1 parent d1daf5f commit e6fff95
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 17 deletions.
26 changes: 11 additions & 15 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
# Config file for golangci-lint
run:
concurrency: 4
deadline: 1m
issues-exit-code: 1
tests: true
skip-dirs:
- .github
- doc
- docker
- logos
- scripts
- util
modules-download-mode: readonly

output:
format: colored-line-number
formats:
- format: colored-line-number
path: stdout
print-issued-lines: true
print-linter-name: true

Expand All @@ -23,13 +17,11 @@ linters:
enable:
# - errcheck
- forbidigo
- gofmt
# - goimports
- goimports
- gosimple
- govet
- ineffassign
# - maligned
- megacheck
- misspell
# - prealloc
- staticcheck
Expand All @@ -44,16 +36,13 @@ linters-settings:
forbid:
- ^fmt\.Print(f|ln)?$
govet:
check-shadowing: false
settings:
printf:
funcs:
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Infof
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf
gofmt:
simple: true
misspell:
locale: US
unparam:
Expand All @@ -64,6 +53,13 @@ linters-settings:
for-loops: true

issues:
exclude-dirs:
- .github
- doc
- docker
- logos
- scripts
- util
exclude-rules:
- path: "main.go" # Excludes main usage
linters: [forbidigo]
Expand Down
2 changes: 1 addition & 1 deletion scripts/runTestsOnTravis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if [ "$1" = "compile" ]; then
go build;

# Now run the linters.
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.56.1;
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.59.1;
golangci-lint run;
if [ "$TRAVIS_TAG" != "" ]; then
go test -race -v -run=TestVersionMatchesTag ./server -ldflags="-X=github.com/nats-io/nats-server/v2/server.serverVersion=$TRAVIS_TAG" -count=1 -vet=off
Expand Down
3 changes: 2 additions & 1 deletion server/jetstream_sourcing_scaling_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ package server

import (
"fmt"
"github.com/nats-io/nats.go"
"strconv"
"testing"
"time"

"github.com/nats-io/nats.go"
)

var serverConfig1 = `
Expand Down

0 comments on commit e6fff95

Please sign in to comment.