Skip to content

Commit 2c9cd41

Browse files
committed
Go 1.24.5, matching linter upgrades
1 parent 6748405 commit 2c9cd41

File tree

3 files changed

+44
-29
lines changed

3 files changed

+44
-29
lines changed

.golangci.yml

Lines changed: 37 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,12 @@
1-
2-
issues:
3-
exclude-files:
4-
# golangci-lint doesn't recognize our generated files (*.gen.go)
5-
- ".+\\.gen\\.go$"
6-
1+
version: "2"
72
linters:
8-
disable-all: true
3+
default: none
94
enable:
105
- errcheck
11-
- gosimple
126
- govet
137
- ineffassign
148
- staticcheck
15-
- typecheck
16-
- unused # everything below this is in addition to enabled-by-default
17-
18-
- goimports
9+
- unused
1910
- copyloopvar
2011
- exhaustive
2112
- unconvert
@@ -30,12 +21,37 @@ linters:
3021
# - gomnd # too strict
3122
# - tagliatelle # naming, not struct tag validness..
3223

33-
# full list available by running: $ golangci-lint linters
34-
35-
linters-settings:
36-
gocritic:
37-
disabled-checks:
38-
- ifElseChain # false positives (some if-else chains with "short ifs" look more cumbersome rewritten)
39-
gosec:
40-
excludes:
41-
- G115 # https://dev.to/ccoveille/about-the-gosec-g115-drama-or-how-i-faced-back-integer-conversion-overflow-in-go-1302
24+
# full list available by running: $ golangci-lint linters settings:
25+
settings:
26+
gocritic:
27+
disabled-checks:
28+
- ifElseChain
29+
gosec:
30+
excludes:
31+
- G115
32+
staticcheck:
33+
checks:
34+
- all
35+
- '-ST1001' # "Dot imports are discouraged."
36+
exclusions:
37+
generated: lax
38+
presets:
39+
- comments
40+
- common-false-positives
41+
- legacy
42+
- std-error-handling
43+
paths:
44+
- .+\.gen\.go$
45+
- third_party$
46+
- builtin$
47+
- examples$
48+
formatters:
49+
enable:
50+
- goimports
51+
exclusions:
52+
generated: lax
53+
paths:
54+
- .+\.gen\.go$
55+
- third_party$
56+
- builtin$
57+
- examples$

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.23.1
1+
FROM golang:1.24.5
22

33
WORKDIR /workspace
44

build-go-project.sh

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,20 +74,19 @@ codeGeneration() {
7474
}
7575

7676
staticAnalysis() {
77-
# if we're in GitHub actions, use such an output format that GitHub knows to display the
78-
# errors inline with the code
79-
local output_format_arg=""
80-
if [ "${GITHUB_ACTIONS:-}" == "true" ]; then
81-
output_format_arg="--out-format=github-actions"
82-
fi
77+
# if [ "${GITHUB_ACTIONS:-}" == "true" ]; then
78+
# TODO: can't specify `--out-format=github-actions` as it was removed removed. we are supposed to use problem matchers:
79+
# https://github.com/golangci/golangci-lint-action/blob/main/problem-matchers.json along with the `text` (the default) format.
80+
# the problem matchers are defined by `golangci-lint-action` and as such encourages vendor lock-in to do everything in discrete actions.
81+
# fi
8382

8483
# its config file is looked up from parent directories, so if we're at /workspace and we have
8584
# /.golangci.yml, that's going to get used (unless there's /workspace/.golangci.yml)
8685

8786
# golangci-lint includes what "$ go vet ./..." would do but also more
8887
# timeout added because default (1m) sometimes timeouts on bigger projects in underpowered GitHub actions.
8988
# more details: https://github.com/golangci/golangci-lint-action/issues/297
90-
golangci-lint run --timeout=3m $output_format_arg
89+
golangci-lint run --timeout=3m
9190
}
9291

9392
builds_count=0

0 commit comments

Comments
 (0)