chore(golangci-lint): upgrade to v2

This commit is contained in:
Ville Skyttä 2025-03-27 00:44:15 +02:00 committed by Marc Khouzam
parent db3ddb5cf4
commit 75790e48fb
4 changed files with 13 additions and 16 deletions

View file

@ -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

View file

@ -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

View file

@ -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}

View file

@ -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