Skip to content

Commit

Permalink
chore: update linter and dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez committed Jan 17, 2025
1 parent 3cd43b4 commit 94656d8
Show file tree
Hide file tree
Showing 5 changed files with 132 additions and 138 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
99 changes: 49 additions & 50 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,50 +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
Expand All @@ -60,7 +13,6 @@ linters:
- errcheck
- errname
- errorlint
- exportloopref
- forbidigo
- forcetypeassert
- funlen
Expand All @@ -85,7 +37,7 @@ linters:
- govet
- importas
- ineffassign
# - makezero # TODO can be used in future. Required to check the current reported issues.
# - makezero # TODO can be used in future. Required to check the current reported issues.
- misspell
- nakedret
- nestif
Expand All @@ -100,14 +52,58 @@ linters:
- tagliatelle
- tenv
- thelper
- typecheck
- unconvert
- unparam
- unused
- usestdlibvars
- 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

issues:
exclude-use-default: false
max-issues-per-linter: 0
Expand All @@ -118,3 +114,6 @@ issues:
linters:
- goconst
- funlen

run:
timeout: 5m
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ test-start-stack:
## Clean local data
.PHONY: clean
clean:
docker-compose -f script/docker-compose.yml down
docker-compose -f script/docker-compose.yml down --remove-orphans
$(RM) goverage.report $(shell find . -type f -name *.out)
15 changes: 8 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,30 @@ module github.com/kvtools/consul
go 1.19

require (
github.com/hashicorp/consul/api v1.29.1
github.com/hashicorp/consul/api v1.31.0
github.com/kvtools/valkeyrie v1.0.0
github.com/stretchr/testify v1.9.0
github.com/stretchr/testify v1.10.0
)

require (
github.com/armon/go-metrics v0.4.1 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/fatih/color v1.17.0 // indirect
github.com/fatih/color v1.18.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-hclog v1.5.0 // indirect
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
github.com/hashicorp/go-metrics v0.5.4 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/go-rootcerts v1.0.2 // indirect
github.com/hashicorp/golang-lru v0.5.4 // indirect
github.com/hashicorp/serf v0.10.1 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/hashicorp/golang-lru v1.0.2 // indirect
github.com/hashicorp/serf v0.10.2 // indirect
github.com/mattn/go-colorable v0.1.14 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63 // indirect
golang.org/x/sys v0.21.0 // indirect
golang.org/x/sys v0.29.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading

0 comments on commit 94656d8

Please sign in to comment.