Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update ci versions #519

Merged
merged 2 commits into from
Apr 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/test-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ jobs:
go-test-lint:
strategy:
matrix:
go: [1.19, 1.18]
golangcli: [v1.53.3]
go: [1.21, 1.22]
golangcli: [v1.57.2]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
cache: true
Expand All @@ -30,10 +30,10 @@ jobs:
git --no-pager diff && [[ 0 -eq $(git status --porcelain | wc -l) ]]

- name: Go Lint
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@v4
with:
version: ${{ matrix.golangcli }}
args: "--out-${NO_FUTURE}format colored-line-number"
args: --out-format=colored-line-number
skip-pkg-cache: true
skip-build-cache: true

Expand Down
27 changes: 19 additions & 8 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
run:
deadline: 6m
skip-dirs:
- terst
skip-files:
- dbg/dbg.go
- token/token_const.go
timeout: 6m

linters-settings:
govet:
check-shadowing: false
settings:
shadow:
strict: true
enable-all: true
goconst:
min-len: 2
min-occurrences: 4
Expand Down Expand Up @@ -57,9 +55,22 @@ linters:
- maligned
# Just causes noise
- depguard
# Go 1.22+ only
- copyloopvar
- intrange

issues:
exclude-use-default: false
max-same-issues: 0
exclude:
- Deferring unsafe method "Close" on type "io\.ReadCloser"
- Deferring unsafe method "Close" on type "io\.ReadCloser"
exclude-dirs:
- terst
exclude-files:
- dbg/dbg.go
- token/token_const.go
exclude-rules:
# Field alignment in tests isn't a performance issue.
- text: fieldalignment
path: _test\.go

2 changes: 1 addition & 1 deletion ast/comments.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ const (

// Comment contains the data of the comment.
type Comment struct {
Begin file.Idx
Text string
Begin file.Idx
Position CommentPosition
}

Expand Down
4 changes: 2 additions & 2 deletions ast/comments_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

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

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

cm := CommentMap{}
cm.AddComment(statement1, comment)
Expand Down
Loading