Skip to content

Commit 49e8d4c

Browse files
renovate[bot]j178
andauthored
chore(deps): update golangci/golangci-lint-action action to v7 (#361)
* chore(deps): update golangci/golangci-lint-action action to v7 * Migrate to v2 config --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Jo <[email protected]>
1 parent 8c48c16 commit 49e8d4c

File tree

5 files changed

+34
-20
lines changed

5 files changed

+34
-20
lines changed

Diff for: .github/workflows/ci.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
with:
1616
go-version: '1.24.x'
1717
- name: golangci-lint
18-
uses: golangci/golangci-lint-action@v6
18+
uses: golangci/golangci-lint-action@v7
1919
with:
2020
version: latest
2121
args: --timeout 3m0s

Diff for: .golangci.yaml

+29-14
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,32 @@
1+
version: "2"
12
linters:
3+
exclusions:
4+
generated: lax
5+
presets:
6+
- comments
7+
- common-false-positives
8+
- legacy
9+
- std-error-handling
10+
paths:
11+
- out
12+
- third_party$
13+
- builtin$
14+
- examples$
15+
formatters:
216
enable:
3-
- gofumpt
417
- gci
5-
6-
issues:
7-
exclude-dirs:
8-
- out
9-
10-
# https://golangci-lint.run/usage/linters#linters-configuration
11-
linters-settings:
12-
gci:
13-
custom-order: true
14-
sections:
15-
- standard
16-
- default
17-
- prefix(github.com/j178/leetgo)
18+
- gofumpt
19+
settings:
20+
gci:
21+
sections:
22+
- standard
23+
- default
24+
- prefix(github.com/j178/leetgo)
25+
custom-order: true
26+
exclusions:
27+
generated: lax
28+
paths:
29+
- out
30+
- third_party$
31+
- builtin$
32+
- examples$

Diff for: cmd/init.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,11 @@ func createConfigFile(dir string) error {
8787
cfg := config.Get()
8888
site := cfg.LeetCode.Site
8989
language := cfg.Language
90-
if initTemplate == "us" {
90+
switch initTemplate {
91+
case "us":
9192
site = config.LeetCodeUS
9293
language = config.EN
93-
} else if initTemplate == "cn" {
94+
case "cn":
9495
site = config.LeetCodeCN
9596
language = config.ZH
9697
}

Diff for: config/config.go

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import (
1515
"gopkg.in/yaml.v3"
1616

1717
"github.com/j178/leetgo/constants"
18-
1918
"github.com/j178/leetgo/utils"
2019
)
2120

Diff for: lang/test.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,9 @@ import (
1111
"github.com/charmbracelet/log"
1212
"github.com/jedib0t/go-pretty/v6/list"
1313

14-
goutils "github.com/j178/leetgo/testutils/go"
15-
1614
"github.com/j178/leetgo/config"
1715
"github.com/j178/leetgo/leetcode"
16+
goutils "github.com/j178/leetgo/testutils/go"
1817
"github.com/j178/leetgo/utils"
1918
)
2019

0 commit comments

Comments
 (0)