Skip to content

Commit 73ae3dc

Browse files
authored
Merge pull request #162 from grafana/dependabot/github_actions/golangci/golangci-lint-action-7
build(deps): bump golangci/golangci-lint-action from 6 to 7
2 parents a3c2033 + c2ed40b commit 73ae3dc

File tree

5 files changed

+42
-36
lines changed

5 files changed

+42
-36
lines changed

.devcontainer/devcontainer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
2525
"ghcr.io/devcontainers/features/go:1": {
2626
"version": "1.23",
27-
"golangciLintVersion": "1.63.4"
27+
"golangciLintVersion": "2.0.2"
2828
},
2929
"ghcr.io/guiyomh/features/goreleaser:0": { "version": "2.6.1" },
3030
"ghcr.io/guiyomh/features/gotestsum:0": { "version": "1.12.1" },

.github/workflows/tooling-validate.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -123,14 +123,14 @@ jobs:
123123
124124
- name: Run minimal golangci-lint ${{ inputs.golangci-lint-version }}
125125
if: ${{ hashFiles('.golangci.yml','.golangci.yaml','.golangci.toml','.golangci.json') == ''}}
126-
uses: golangci/golangci-lint-action@v6
126+
uses: golangci/golangci-lint-action@v7
127127
with:
128128
version: "${{ inputs.golangci-lint-version }}"
129129
args: --timeout=30m --no-config --presets bugs --enable gofmt
130130

131131
- name: Run configured golangci-lint ${{ inputs.golangci-lint-version }}
132132
if: ${{ hashFiles('.golangci.yml','.golangci.yaml','.golangci.toml','.golangci.json') != ''}}
133-
uses: golangci/golangci-lint-action@v6
133+
uses: golangci/golangci-lint-action@v7
134134
with:
135135
version: "${{ inputs.golangci-lint-version }}"
136136
only-new-issues: true

.golangci.yml

+31-30
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,40 @@
1-
issues:
2-
max-issues-per-linter: 0
3-
max-same-issues: 0
4-
exclude-use-default: false
5-
exclude-dirs:
6-
# adopted from fixuid source: https://github.com/boxboat/fixuid
7-
- internal/fixids
8-
1+
version: "2"
92
linters:
10-
enable-all: true
3+
default: all
114
disable:
12-
# Except for general-purpose public APIs,
13-
# wrapping errors is more inconvenient and error prone than useful.
14-
- wrapcheck
15-
16-
# Many go standard library API functions have typical parameter names shorter than 3 characters.
17-
# It is better to use the usual parameter names than to create one that conforms to the rule.
18-
- varnamelen
19-
205
# In many cases (e.g. options) it is normal usage not to specify all structure fields.
216
- exhaustruct
227

23-
# The linter 'exportloopref' is deprecated (since v1.60.2) due to:
24-
# Since Go1.22 (loopvar) this linter is no longer relevant.
25-
# Replaced by copyloopvar.
26-
- exportloopref
27-
288
# TODO Temporary: Builder struct json field names do not comply with this rule,
299
# but this struct will be refactored soon.
3010
- tagliatelle
3111

32-
linters-settings:
33-
depguard:
34-
rules:
35-
prevent_accidental_imports:
36-
allow:
37-
- $gostd
38-
- github.com/stretchr/testify/require
39-
- github.com/grafana/k6foundry
12+
# Many go standard library API functions have typical parameter names shorter than 3 characters.
13+
# It is better to use the usual parameter names than to create one that conforms to the rule.
14+
- varnamelen
15+
16+
# Except for general-purpose public APIs,
17+
# wrapping errors is more inconvenient and error prone than useful.
18+
- wrapcheck
19+
settings:
20+
depguard:
21+
rules:
22+
prevent_accidental_imports:
23+
allow:
24+
- $gostd
25+
- github.com/stretchr/testify/require
26+
- github.com/grafana/k6foundry
27+
- go.k6.io/xk6
28+
exclusions:
29+
paths:
30+
# adopted from fixuid source: https://github.com/boxboat/fixuid
31+
- internal/fixids
32+
issues:
33+
max-issues-per-linter: 0
34+
max-same-issues: 0
35+
formatters:
36+
enable:
37+
- gci
38+
- gofmt
39+
- gofumpt
40+
- goimports

internal/legacy/builder.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,13 @@ func (b Builder) newBuilderEnv(log *slog.Logger) map[string]string {
9191
raceArg := "-race"
9292

9393
// trim debug symbols by default
94-
if (b.RaceDetector || strings.Contains(b.BuildFlags, raceArg)) && !b.Compile.Cgo {
94+
if (b.RaceDetector || strings.Contains(b.BuildFlags, raceArg)) && !b.Cgo {
9595
log.Warn("Enabling cgo because it is required by the race detector")
9696

97-
b.Compile.Cgo = true
97+
b.Cgo = true
9898
}
9999

100-
env["CGO_ENABLED"] = b.Compile.CgoEnabled()
100+
env["CGO_ENABLED"] = b.CgoEnabled()
101101

102102
return env
103103
}

releases/v0.16.0.md

+5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ This release includes:
44
- Public xk6 Builder API removed
55
- New golangci-lint configuration
66
- New Dependabot configuration
7+
- golangci-lint updated to v2.0.2
78

89
## Breaking changes
910

@@ -31,3 +32,7 @@ Dependabot has been configured to keep the following dependencies up to date:
3132
- Docker base images
3233
- Dev Container features
3334
- GitHub Actions
35+
36+
### golangci-lint updated to v2.0.2
37+
38+
Using [Development Containers](https://containers.dev/) allows for easy updating of the [golangci-lint](https://github.com/golangci/golangci-lint) version. The pull request opened by Dependabot had to be modified a bit because changing the golangci-lint major version means a completely different configuration file format. From now on, xk6 uses `golangci-lint v2.0.2`.

0 commit comments

Comments
 (0)