diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cd05fc8..23c2600 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,7 +3,7 @@ name: Build and test on: [push, pull_request] env: - GOLANGCI_LINT_VERSION: v1.59.1 + GOLANGCI_LINT_VERSION: v1.63.4 jobs: build: diff --git a/.golangci.yml b/.golangci.yml index db797d1..9950b81 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,51 +1,3 @@ -run: - timeout: 5m - -linters-settings: - govet: - enable-all: true - disable: - - fieldalignment - gocyclo: - min-complexity: 15 - goconst: - min-len: 5 - min-occurrences: 3 - misspell: - locale: US - funlen: - lines: -1 - statements: 40 - godox: - keywords: - - FIXME - gofumpt: - extra-rules: false - depguard: - rules: - main: - deny: - - pkg: "github.com/instana/testify" - desc: not allowed - - pkg: "github.com/sirupsen/logrus" - desc: not allowed - - pkg: "github.com/pkg/errors" - desc: Should be replaced by standard lib errors package - gocritic: - enabled-tags: - - diagnostic - - style - - performance - disabled-checks: - - unnamedResult - - sloppyReassign - - rangeValCopy - - octalLiteral - - paramTypeCombine # already handle by gofumpt.extra-rules - settings: - hugeParam: - sizeThreshold: 100 - linters: disable-all: true enable: @@ -59,7 +11,6 @@ linters: - errcheck - errname - errorlint - - exportloopref - forbidigo - forcetypeassert - funlen @@ -99,7 +50,6 @@ linters: - tagliatelle - tenv - thelper - - typecheck - unconvert - unparam - unused @@ -107,6 +57,54 @@ linters: - wastedassign - whitespace +linters-settings: + govet: + enable-all: true + disable: + - fieldalignment + gocyclo: + min-complexity: 15 + goconst: + min-len: 5 + min-occurrences: 3 + misspell: + locale: US + funlen: + lines: -1 + statements: 40 + godox: + keywords: + - FIXME + gofumpt: + extra-rules: false + depguard: + rules: + main: + deny: + - pkg: "github.com/instana/testify" + desc: not allowed + - pkg: "github.com/sirupsen/logrus" + desc: not allowed + - pkg: "github.com/pkg/errors" + desc: Should be replaced by standard lib errors package + gocritic: + enabled-tags: + - diagnostic + - style + - performance + disabled-checks: + - unnamedResult + - sloppyReassign + - rangeValCopy + - octalLiteral + - paramTypeCombine # already handle by gofumpt.extra-rules + settings: + hugeParam: + sizeThreshold: 100 + gosec: + excludes: + - G115 + issues: exclude-use-default: false max-issues-per-linter: 0 @@ -119,3 +117,6 @@ issues: - funlen - path: redis.go text: 'Function `NewClient->newConnPool->NewConnPool->reaper->checkMinIdleConns` should pass the context parameter' + +run: + timeout: 5m diff --git a/Makefile b/Makefile index 6abf201..2429582 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -m.PHONY: all +.PHONY: all all: validate test clean ## Run validates @@ -25,6 +25,7 @@ test-start-stack: ## Clean local data .PHONY: clean clean: - docker-compose -f script/docker-compose.yml down - docker-compose -f script/docker-compose-sentinel.yml down + rm -f ./script/conf/sentinel1.conf ./script/conf/sentinel2.conf ./script/conf/sentinel3.conf + docker-compose -f script/docker-compose.yml down --remove-orphans + docker-compose -f script/docker-compose-sentinel.yml down --remove-orphans $(RM) goverage.report $(shell find . -type f -name *.out) diff --git a/go.mod b/go.mod index b4061e7..bb3e591 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.19 require ( github.com/kvtools/valkeyrie v1.0.0 github.com/redis/go-redis/v9 v9.2.1 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 ) require ( diff --git a/go.sum b/go.sum index 1374784..31c15ba 100644 --- a/go.sum +++ b/go.sum @@ -16,8 +16,8 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/redis/go-redis/v9 v9.2.1 h1:WlYJg71ODF0dVspZZCpYmoF1+U1Jjk9Rwd7pq6QmlCg= github.com/redis/go-redis/v9 v9.2.1/go.mod h1:hdY0cQFCN4fnSYT6TkisLufl/4W5UIXyv0b/CLO2V2M= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=