Skip to content

Commit 222f6f0

Browse files
build(deps): bump golangci/golangci-lint-action from 6 to 7 (#746)
* build(deps): bump golangci/golangci-lint-action from 6 to 7 Dependabot couldn't find the original pull request head commit, e630017. * migrate golangci-lint to v2 Signed-off-by: Etai Lev Ran <elevran@gmail.com> * lint v2 does not support timeout in config, so add explicitly Signed-off-by: Etai Lev Ran <elevran@gmail.com> * update linters version to v2 latest Signed-off-by: Etai Lev Ran <elevran@gmail.com> --------- Signed-off-by: Etai Lev Ran <elevran@gmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Etai Lev Ran <elevran@gmail.com>
1 parent 02c1bb2 commit 222f6f0

File tree

3 files changed

+69
-90
lines changed

3 files changed

+69
-90
lines changed

.github/workflows/pr-check.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ jobs:
3131
- name: Run vet check
3232
run: go vet ./...
3333
- name: Run linters
34-
uses: golangci/golangci-lint-action@v6
34+
uses: golangci/golangci-lint-action@v8
3535
with:
36-
version: v1.54.2
36+
version: v2.3.1
3737
skip-pkg-cache: true
3838

3939
unit-tests:

.golangci.yaml

Lines changed: 66 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
11
# Based on recommendations in https://olegk.dev/go-linters-configuration-the-right-version
22

3+
version: "2"
34
run:
4-
# linter execution
5-
timeout: 30m
6-
issues-exit-code: 1
75
concurrency: 4
8-
# check tests as well
9-
tests: true
10-
# fail if go.mod file is outdated.
11-
modules-download-mode: readonly
12-
# use the Go version from the go.mod file.
136
go: ""
14-
7+
modules-download-mode: readonly
8+
issues-exit-code: 1
9+
tests: true
10+
output:
11+
formats:
12+
text:
13+
path: stdout
14+
print-linter-name: true
15+
print-issued-lines: false
16+
colors: false
1517
linters:
16-
# set to true to run only fast linters (e.g., for pre-commit)
17-
fast: false
18-
19-
disable-all: true
18+
default: none
2019
enable:
2120
- asasalint
2221
- asciicheck
@@ -27,20 +26,16 @@ linters:
2726
- errcheck
2827
- errname
2928
- errorlint
30-
- exportloopref
3129
- ginkgolinter
3230
- gocritic
3331
- godot
34-
- gofumpt
35-
- goimports
3632
- gosec
37-
- gosimple
3833
- govet
3934
- grouper
40-
- lll
41-
- loggercheck
4235
- importas
4336
- ineffassign
37+
- lll
38+
- loggercheck
4439
- makezero
4540
- misspell
4641
- nakedret
@@ -57,86 +52,70 @@ linters:
5752
- reassign
5853
- revive
5954
- staticcheck
60-
- stylecheck
6155
- tagliatelle
62-
- tenv
6356
- testableexamples
64-
- thelper
6557
- testpackage
58+
- thelper
6659
- tparallel
6760
- unconvert
6861
- unparam
6962
- unused
7063
- usestdlibvars
7164
- varnamelen
7265
- whitespace
73-
74-
linters-settings:
75-
gocritic:
76-
enabled-tags:
77-
- diagnostic
78-
- experimental
79-
- opinionated
80-
- performance
81-
- style
82-
83-
errcheck:
84-
# change some error checks which are disabled by default
85-
check-type-assertions: true
86-
check-blank: true
87-
88-
nakedret:
89-
# No naked returns (default: 30)
90-
max-func-lines: 1
91-
92-
lll:
93-
# max line length, lines longer will be reported. Default is 120.
94-
line-length: 130
95-
96-
staticcheck:
97-
checks:
98-
- "all"
99-
100-
stylecheck:
101-
102-
varnamelen:
103-
# The longest distance, in source lines, that is being considered a "small scope".
104-
# Variables used in at most this many lines will be ignored (Default: 5)
105-
max-distance: 20
106-
# The minimum length of a variable's name that is considered "long".
107-
# Variable names that are at least this long will be ignored (Default: 3)
108-
min-name-length: 2
109-
# Check type parameters (Default: false)
110-
check-type-param: true
111-
# Ignore "ok" variables that hold the bool return value of a type assertion,
112-
# map index, or channel receive (default: false)
113-
ignore-type-assert-ok: true
114-
ignore-map-index-ok: true
115-
ignore-chan-recv-ok: true
116-
# Optional list of variable declarations that should be ignored completely.
117-
ignore-decls:
118-
- c echo.Context
119-
- t *testing.T
120-
- w http.ResponseWriter
121-
- r *http.Request
122-
123-
output:
124-
# prefer the simplest output: `line-number` without saving to file
125-
formats:
126-
- format: line-number
127-
print-issued-lines: false
128-
print-linter-name: true
129-
# allow multiple reports per line
130-
uniq-by-line: false
131-
# easier to follow the results with a deterministic output
132-
sort-results: true
133-
66+
settings:
67+
errcheck:
68+
check-type-assertions: true
69+
check-blank: true
70+
gocritic:
71+
enabled-tags:
72+
- diagnostic
73+
- experimental
74+
- opinionated
75+
- performance
76+
- style
77+
lll:
78+
line-length: 130
79+
nakedret:
80+
max-func-lines: 1
81+
staticcheck:
82+
checks:
83+
- all
84+
varnamelen:
85+
max-distance: 20
86+
min-name-length: 2
87+
check-type-param: true
88+
ignore-type-assert-ok: true
89+
ignore-map-index-ok: true
90+
ignore-chan-recv-ok: true
91+
ignore-decls:
92+
- c echo.Context
93+
- t *testing.T
94+
- w http.ResponseWriter
95+
- r *http.Request
96+
exclusions:
97+
generated: lax
98+
presets:
99+
- comments
100+
- common-false-positives
101+
- legacy
102+
- std-error-handling
103+
paths:
104+
- third_party$
105+
- builtin$
106+
- examples$
134107
issues:
135-
# setting 0 to have all the results.
136108
max-issues-per-linter: 0
137-
# nothing should be skipped to not miss errors.
138109
max-same-issues: 0
139-
# analyze only new code (manually set to false to check existing code)
140110
new: true
141-
# do not automatically fix (until AI assisted code improves)
142111
fix: false
112+
formatters:
113+
enable:
114+
- gofumpt
115+
- goimports
116+
exclusions:
117+
generated: lax
118+
paths:
119+
- third_party$
120+
- builtin$
121+
- examples$

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ fmt: gofumpt format-go tidy-go vet-go
5353
vet: vet-go
5454

5555
lint: ; $(info running linters...)
56-
@golangci-lint run --config=./.golangci.yaml ./...
56+
@golangci-lint run --timeout 5m --config=./.golangci.yaml ./...
5757

5858
tidy-go: ; $(info tidying up go.mod...)
5959
@go mod tidy

0 commit comments

Comments
 (0)