Skip to content

Commit

Permalink
chore(i): Bump golangci-lint to v1.64 (#3446)
Browse files Browse the repository at this point in the history
## Relevant issue(s)
Resolves #3445

## Description
- Bump golangci-lint
- Fix deprecated warnings
  • Loading branch information
shahzadlone authored Feb 21, 2025
1 parent 2dd5537 commit 9302cff
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
# Required: the version of golangci-lint is required.
# Note: The version should not pick the patch version as the latest patch
# version is what will always be used.
version: v1.61
version: v1.64

# Optional: working directory, useful for monorepos or if we wanted to run this
# on a non-root directory.
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ client\:add-schema:

.PHONY: deps\:lint-go
deps\:lint-go:
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.61
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.64

.PHONY: deps\:lint-yaml
deps\:lint-yaml:
Expand Down
7 changes: 5 additions & 2 deletions tests/integration/results.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,12 @@ func (ucid *UniqueCid) Validate(s *state, actualValue any, msgAndArgs ...any) {
}

if isNew {
require.IsType(s.t, "", actualValue)
value, ok := actualValue.(string)
if !ok {
require.Fail(s.t, "UniqueCid actualValue string cast failed")
}

cid, err := cid.Decode(actualValue.(string))
cid, err := cid.Decode(value)
if err != nil {
require.NoError(s.t, err)
}
Expand Down
23 changes: 6 additions & 17 deletions tools/configs/golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ run:
skip-dirs:
# - net/

# Enables skipping of directories:
# vendor$, third_party$, testdata$, examples$, Godeps$, builtin$
skip-dirs-use-default: true

# which files to skip: they will be analyzed, but issues from them
# won't be reported. Default value is empty list, but there is
# no need to include all autogenerated files, we confidently recognize
Expand Down Expand Up @@ -72,9 +68,6 @@ output:
# print linter name in the end of issue text.
print-linter-name: true

# make issues output unique by line.
uniq-by-line: true

# add a prefix to the output file references.
path-prefix: ""

Expand Down Expand Up @@ -131,6 +124,9 @@ linters:

#====================================================[ Tweaks To Fix Issues or Exclude linter(s) on Select Locations ]
issues:
# Make issues output unique by line.
uniq-by-line: true

# List of regexps of issue texts to exclude, empty list by default.
# But independently from this option we use default exclude patterns,
# it can be disabled by `exclude-use-default: false`. To list all
Expand Down Expand Up @@ -331,9 +327,6 @@ linters-settings:
# instead of using fmt.Print(fmt.Sprintf(...)), one can use fmt.Printf(...).

govet:
# report about shadowed variables
check-shadowing: false

# settings per analyzer
settings:
printf: # analyzer name, run `go tool vet help` to see all analyzers
Expand All @@ -343,18 +336,14 @@ linters-settings:
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf

# enable or disable analyzers by name
# run `go tool vet help` to see all analyzers
enable-all: true
enable:
- atomicalign
- nilness

enable-all: false

disable-all: false
disable:
- shadow
- fieldalignment

disable-all: false

lll:
# max line length, lines longer will be reported.
Expand Down

0 comments on commit 9302cff

Please sign in to comment.