Skip to content

Commit d5de060

Browse files
authored
Merge pull request #412 from maratori/dependabot/docker/golangci/golangci-lint-v2.12.1
Bump golangci/golangci-lint from v2.11.4 to v2.12.1
2 parents db56e59 + a1d387c commit d5de060

4 files changed

Lines changed: 21 additions & 18 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ jobs:
6565
go-version: "1.26.2" # update together with dev.dockerfile
6666
- uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0
6767
with:
68-
version: "v2.11.4" # update together with dev.dockerfile
68+
version: "v2.12.1" # update together with dev.dockerfile
6969

7070
lint-latest-deps:
7171
runs-on: ubuntu-latest
@@ -77,7 +77,7 @@ jobs:
7777
- run: make apply-latest-deps
7878
- uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0
7979
with:
80-
version: "v2.11.4" # update together with dev.dockerfile
80+
version: "v2.12.1" # update together with dev.dockerfile
8181

8282
check-tidy:
8383
name: go mod tidy

.golangci.yml

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ linters:
4040
- bidichk # checks for dangerous unicode character sequences
4141
- bodyclose # checks whether HTTP response body is closed successfully
4242
- canonicalheader # checks whether net/http.Header uses canonical header
43+
- clickhouselint # detects common mistakes with the ClickHouse native Go driver API
4344
- copyloopvar # detects places where loop variables are copied (Go 1.22+)
4445
- cyclop # checks function and package cyclomatic complexity
4546
- depguard # checks if package imports are in a list of acceptable packages
@@ -89,6 +90,7 @@ linters:
8990
- nolintlint # reports ill-formed or insufficient nolint directives
9091
- nonamedreturns # reports all named returns
9192
- nosprintfhostport # checks for misuse of Sprintf to construct a host with port in a URL
93+
- paralleltest # detects missing usage of t.Parallel() method in your Go test
9294
- perfsprint # checks that fmt.Sprintf can be replaced with a faster alternative
9395
- predeclared # finds code that shadows one of Go's predeclared identifiers
9496
- promlinter # checks Prometheus metrics naming via promlint
@@ -146,7 +148,6 @@ linters:
146148
#- maintidx # measures the maintainability index of each function
147149
#- misspell # [useless] finds commonly misspelled English words in comments
148150
#- nlreturn # [too strict and mostly code is not more readable] checks for a new line before return and branch statements to increase code clarity
149-
#- paralleltest # [too many false positives] detects missing usage of t.Parallel() method in your Go test
150151
#- tagliatelle # checks the struct tags
151152
#- thelper # detects golang test helpers without t.Helper() call and checks the consistency of test helpers
152153
#- wsl # [too strict and mostly code is not more readable] whitespace linter forces you to use empty lines
@@ -395,21 +396,15 @@ linters:
395396
- github.com/jmoiron/sqlx
396397

397398
sloglint:
398-
# Enforce not using global loggers.
399-
# Values:
400-
# - "": disabled
401-
# - "all": report all global loggers
402-
# - "default": report only the default slog logger
403-
# https://github.com/go-simpler/sloglint?tab=readme-ov-file#no-global
404-
# Default: ""
399+
# Report the use of global loggers.
400+
# https://github.com/go-simpler/sloglint#no-global-logger
401+
# Values: "all", "default"
402+
# Default: "" (disabled)
405403
no-global: all
406-
# Enforce using methods that accept a context.
407-
# Values:
408-
# - "": disabled
409-
# - "all": report all contextless calls
410-
# - "scope": report only if a context exists in the scope of the outermost function
411-
# https://github.com/go-simpler/sloglint?tab=readme-ov-file#context-only
412-
# Default: ""
404+
# Report the use of functions without a context.Context.
405+
# https://github.com/go-simpler/sloglint#context-only
406+
# Values: "all", "scope"
407+
# Default: "" (disabled)
413408
context: scope
414409

415410
staticcheck:

dev.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
FROM golang:1.26.2 AS go
33

44
# update together with .github/workflows/ci.yml
5-
FROM golangci/golangci-lint:v2.11.4 AS linter
5+
FROM golangci/golangci-lint:v2.12.1 AS linter
66

77
FROM go AS dev
88
ENV INSIDE_DEV_CONTAINER=1

pkg/testpackage/testpackage_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import (
1010
)
1111

1212
func TestAnalyzer_Good(t *testing.T) {
13+
t.Parallel()
14+
1315
testdata, err := filepath.Abs("testdata/good")
1416
if err != nil {
1517
t.FailNow()
@@ -19,6 +21,8 @@ func TestAnalyzer_Good(t *testing.T) {
1921
}
2022

2123
func TestAnalyzer_Bad(t *testing.T) {
24+
t.Parallel()
25+
2226
testdata, err := filepath.Abs("testdata/bad")
2327
if err != nil {
2428
t.FailNow()
@@ -28,6 +32,8 @@ func TestAnalyzer_Bad(t *testing.T) {
2832
}
2933

3034
func TestAnalyzer_Allowed(t *testing.T) {
35+
t.Parallel()
36+
3137
analyzer := testpackage.NewAnalyzer()
3238
err := analyzer.Flags.Set(testpackage.AllowPackagesFlagName, "allowed")
3339

@@ -44,6 +50,8 @@ func TestAnalyzer_Allowed(t *testing.T) {
4450
}
4551

4652
func TestAnalyzer_InvalidRegexp(t *testing.T) {
53+
t.Parallel()
54+
4755
invalid := `\Ca`
4856
analyzer := testpackage.NewAnalyzer()
4957
err := analyzer.Flags.Set(testpackage.SkipRegexpFlagName, invalid)

0 commit comments

Comments
 (0)