Skip to content

Commit ee40ed2

Browse files
committed
chore(lint): update golangci config and fix test cleanup
Update .golangci.yml to use config version 2 and re-enable tenv and gofumpt linters Ensure cli checkstyle test checks errors from temporary file Close() Update golangci-lint action
1 parent 6acf3b9 commit ee40ed2

3 files changed

Lines changed: 7 additions & 5 deletions

File tree

.github/workflows/go.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
run: make build
3434

3535
- name: golangci-lint
36-
uses: golangci/golangci-lint-action@v6
36+
uses: golangci/golangci-lint-action@v9
3737
with:
3838
version: latest
3939

.golangci.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# See https://golangci-lint.run/usage/configuration/
1+
version: 2
2+
23
linters:
34
enable-all: true
45
disable:
5-
- tenv
66
- lll
77
- gomodguard
88
- gochecknoglobals
@@ -13,7 +13,6 @@ linters:
1313
- forbidigo
1414
- funlen
1515
- nlreturn
16-
- gofumpt
1716
- nonamedreturns
1817
- cyclop
1918
- err113

internal/cli/cli_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@ func TestCmdRun(t *testing.T) {
3333
func TestWriteCheckstyle(t *testing.T) {
3434
outFile, err := os.CreateTemp(t.TempDir(), "checkstyle-*.xml")
3535
require.NoError(t, err)
36-
defer outFile.Close()
36+
defer func() {
37+
err := outFile.Close()
38+
require.NoError(t, err)
39+
}()
3740

3841
issues := []gomodguard.Issue{
3942
{

0 commit comments

Comments
 (0)