diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2904bf0e..f6a3111b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -47,7 +47,7 @@ jobs: check-latest: true cache: true - - uses: golangci/golangci-lint-action@v4.0.0 + - uses: golangci/golangci-lint-action@v8.0.0 with: version: latest args: --verbose diff --git a/.golangci.yml b/.golangci.yml index 2c8f4808..71688aa3 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -12,14 +12,20 @@ # See the License for the specific language governing permissions and # limitations under the License. +version: "2" + run: - deadline: 5m + timeout: 5m + +formatters: + enable: + - gofmt + - goimports linters: - disable-all: true + default: none enable: #- bodyclose - # - deadcode ! deprecated since v1.49.0; replaced by 'unused' #- depguard #- dogsled #- dupl @@ -30,28 +36,19 @@ linters: - goconst - gocritic #- gocyclo - - gofmt - - goimports - #- gomnd #- goprintffuncname - gosec - - gosimple - govet - ineffassign #- lll - misspell + #- mnd #- nakedret #- noctx - nolintlint #- rowserrcheck - #- scopelint - staticcheck - #- structcheck ! deprecated since v1.49.0; replaced by 'unused' - - stylecheck - #- typecheck - unconvert #- unparam - unused - # - varcheck ! deprecated since v1.49.0; replaced by 'unused' #- whitespace - fast: false diff --git a/command_test.go b/command_test.go index 156df9eb..a86e57f0 100644 --- a/command_test.go +++ b/command_test.go @@ -2926,7 +2926,7 @@ func TestHelpFuncExecuted(t *testing.T) { helpText := "Long description" // Create a context that will be unique, not just the background context - //nolint:golint,staticcheck // We can safely use a basic type as key in tests. + //nolint:staticcheck // We can safely use a basic type as key in tests. executionCtx := context.WithValue(context.Background(), "testKey", "123") child := &Command{Use: "child", Run: emptyRun} diff --git a/completions_test.go b/completions_test.go index 89da3d50..71c0d1ff 100644 --- a/completions_test.go +++ b/completions_test.go @@ -1297,7 +1297,7 @@ func TestValidArgsFuncCmdContext(t *testing.T) { } rootCmd.AddCommand(childCmd) - //nolint:golint,staticcheck // We can safely use a basic type as key in tests. + //nolint:staticcheck // We can safely use a basic type as key in tests. ctx := context.WithValue(context.Background(), "testKey", "123") // Test completing an empty string on the childCmd