Skip to content

Commit 75790e4

Browse files
scopmarckhouzam
authored andcommitted
chore(golangci-lint): upgrade to v2
1 parent db3ddb5 commit 75790e4

File tree

4 files changed

+13
-16
lines changed

4 files changed

+13
-16
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
check-latest: true
4848
cache: true
4949

50-
- uses: golangci/golangci-lint-action@v4.0.0
50+
- uses: golangci/golangci-lint-action@v8.0.0
5151
with:
5252
version: latest
5353
args: --verbose

.golangci.yml

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,20 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
version: "2"
16+
1517
run:
16-
deadline: 5m
18+
timeout: 5m
19+
20+
formatters:
21+
enable:
22+
- gofmt
23+
- goimports
1724

1825
linters:
19-
disable-all: true
26+
default: none
2027
enable:
2128
#- bodyclose
22-
# - deadcode ! deprecated since v1.49.0; replaced by 'unused'
2329
#- depguard
2430
#- dogsled
2531
#- dupl
@@ -30,28 +36,19 @@ linters:
3036
- goconst
3137
- gocritic
3238
#- gocyclo
33-
- gofmt
34-
- goimports
35-
#- gomnd
3639
#- goprintffuncname
3740
- gosec
38-
- gosimple
3941
- govet
4042
- ineffassign
4143
#- lll
4244
- misspell
45+
#- mnd
4346
#- nakedret
4447
#- noctx
4548
- nolintlint
4649
#- rowserrcheck
47-
#- scopelint
4850
- staticcheck
49-
#- structcheck ! deprecated since v1.49.0; replaced by 'unused'
50-
- stylecheck
51-
#- typecheck
5251
- unconvert
5352
#- unparam
5453
- unused
55-
# - varcheck ! deprecated since v1.49.0; replaced by 'unused'
5654
#- whitespace
57-
fast: false

command_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2926,7 +2926,7 @@ func TestHelpFuncExecuted(t *testing.T) {
29262926
helpText := "Long description"
29272927

29282928
// Create a context that will be unique, not just the background context
2929-
//nolint:golint,staticcheck // We can safely use a basic type as key in tests.
2929+
//nolint:staticcheck // We can safely use a basic type as key in tests.
29302930
executionCtx := context.WithValue(context.Background(), "testKey", "123")
29312931

29322932
child := &Command{Use: "child", Run: emptyRun}

completions_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1297,7 +1297,7 @@ func TestValidArgsFuncCmdContext(t *testing.T) {
12971297
}
12981298
rootCmd.AddCommand(childCmd)
12991299

1300-
//nolint:golint,staticcheck // We can safely use a basic type as key in tests.
1300+
//nolint:staticcheck // We can safely use a basic type as key in tests.
13011301
ctx := context.WithValue(context.Background(), "testKey", "123")
13021302

13031303
// Test completing an empty string on the childCmd

0 commit comments

Comments
 (0)