Skip to content

Commit 98effe0

Browse files
authored
chore: update ci versions (#519)
Update go, golangci-lint and action versions. Address new lint failures flagged by updated golangci-lint version.
1 parent b755419 commit 98effe0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+595
-627
lines changed

.github/workflows/test-lint.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@ jobs:
88
go-test-lint:
99
strategy:
1010
matrix:
11-
go: [1.19, 1.18]
12-
golangcli: [v1.53.3]
11+
go: [1.21, 1.22]
12+
golangcli: [v1.57.2]
1313
os: [ubuntu-latest]
1414
runs-on: ${{ matrix.os }}
1515
steps:
1616
- name: Checkout
17-
uses: actions/checkout@v3
17+
uses: actions/checkout@v4
1818

1919
- name: Set up Go
20-
uses: actions/setup-go@v3
20+
uses: actions/setup-go@v5
2121
with:
2222
go-version: ${{ matrix.go }}
2323
cache: true
@@ -30,10 +30,10 @@ jobs:
3030
git --no-pager diff && [[ 0 -eq $(git status --porcelain | wc -l) ]]
3131
3232
- name: Go Lint
33-
uses: golangci/golangci-lint-action@v3
33+
uses: golangci/golangci-lint-action@v4
3434
with:
3535
version: ${{ matrix.golangcli }}
36-
args: "--out-${NO_FUTURE}format colored-line-number"
36+
args: --out-format=colored-line-number
3737
skip-pkg-cache: true
3838
skip-build-cache: true
3939

.golangci.yml

+19-8
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
run:
2-
deadline: 6m
3-
skip-dirs:
4-
- terst
5-
skip-files:
6-
- dbg/dbg.go
7-
- token/token_const.go
2+
timeout: 6m
83

94
linters-settings:
105
govet:
11-
check-shadowing: false
6+
settings:
7+
shadow:
8+
strict: true
9+
enable-all: true
1210
goconst:
1311
min-len: 2
1412
min-occurrences: 4
@@ -57,9 +55,22 @@ linters:
5755
- maligned
5856
# Just causes noise
5957
- depguard
58+
# Go 1.22+ only
59+
- copyloopvar
60+
- intrange
6061

6162
issues:
6263
exclude-use-default: false
6364
max-same-issues: 0
6465
exclude:
65-
- Deferring unsafe method "Close" on type "io\.ReadCloser"
66+
- Deferring unsafe method "Close" on type "io\.ReadCloser"
67+
exclude-dirs:
68+
- terst
69+
exclude-files:
70+
- dbg/dbg.go
71+
- token/token_const.go
72+
exclude-rules:
73+
# Field alignment in tests isn't a performance issue.
74+
- text: fieldalignment
75+
path: _test\.go
76+

ast/comments.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ const (
3838

3939
// Comment contains the data of the comment.
4040
type Comment struct {
41-
Begin file.Idx
4241
Text string
42+
Begin file.Idx
4343
Position CommentPosition
4444
}
4545

ast/comments_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88

99
func TestCommentMap(t *testing.T) {
1010
statement := &EmptyStatement{file.Idx(1)}
11-
comment := &Comment{1, "test", LEADING}
11+
comment := &Comment{Begin: 1, Text: "test", Position: LEADING}
1212

1313
cm := CommentMap{}
1414
cm.AddComment(statement, comment)
@@ -29,7 +29,7 @@ func TestCommentMap(t *testing.T) {
2929
func TestCommentMap_move(t *testing.T) {
3030
statement1 := &EmptyStatement{file.Idx(1)}
3131
statement2 := &EmptyStatement{file.Idx(2)}
32-
comment := &Comment{1, "test", LEADING}
32+
comment := &Comment{Begin: 1, Text: "test", Position: LEADING}
3333

3434
cm := CommentMap{}
3535
cm.AddComment(statement1, comment)

0 commit comments

Comments
 (0)