mirror of
https://github.com/spf13/cobra
synced 2025-06-07 12:57:18 +00:00
chore(golangci-lint): upgrade to v2
This commit is contained in:
parent
db3ddb5cf4
commit
75790e48fb
4 changed files with 13 additions and 16 deletions
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
|
@ -47,7 +47,7 @@ jobs:
|
||||||
check-latest: true
|
check-latest: true
|
||||||
cache: true
|
cache: true
|
||||||
|
|
||||||
- uses: golangci/golangci-lint-action@v4.0.0
|
- uses: golangci/golangci-lint-action@v8.0.0
|
||||||
with:
|
with:
|
||||||
version: latest
|
version: latest
|
||||||
args: --verbose
|
args: --verbose
|
||||||
|
|
|
@ -12,14 +12,20 @@
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
|
version: "2"
|
||||||
|
|
||||||
run:
|
run:
|
||||||
deadline: 5m
|
timeout: 5m
|
||||||
|
|
||||||
|
formatters:
|
||||||
|
enable:
|
||||||
|
- gofmt
|
||||||
|
- goimports
|
||||||
|
|
||||||
linters:
|
linters:
|
||||||
disable-all: true
|
default: none
|
||||||
enable:
|
enable:
|
||||||
#- bodyclose
|
#- bodyclose
|
||||||
# - deadcode ! deprecated since v1.49.0; replaced by 'unused'
|
|
||||||
#- depguard
|
#- depguard
|
||||||
#- dogsled
|
#- dogsled
|
||||||
#- dupl
|
#- dupl
|
||||||
|
@ -30,28 +36,19 @@ linters:
|
||||||
- goconst
|
- goconst
|
||||||
- gocritic
|
- gocritic
|
||||||
#- gocyclo
|
#- gocyclo
|
||||||
- gofmt
|
|
||||||
- goimports
|
|
||||||
#- gomnd
|
|
||||||
#- goprintffuncname
|
#- goprintffuncname
|
||||||
- gosec
|
- gosec
|
||||||
- gosimple
|
|
||||||
- govet
|
- govet
|
||||||
- ineffassign
|
- ineffassign
|
||||||
#- lll
|
#- lll
|
||||||
- misspell
|
- misspell
|
||||||
|
#- mnd
|
||||||
#- nakedret
|
#- nakedret
|
||||||
#- noctx
|
#- noctx
|
||||||
- nolintlint
|
- nolintlint
|
||||||
#- rowserrcheck
|
#- rowserrcheck
|
||||||
#- scopelint
|
|
||||||
- staticcheck
|
- staticcheck
|
||||||
#- structcheck ! deprecated since v1.49.0; replaced by 'unused'
|
|
||||||
- stylecheck
|
|
||||||
#- typecheck
|
|
||||||
- unconvert
|
- unconvert
|
||||||
#- unparam
|
#- unparam
|
||||||
- unused
|
- unused
|
||||||
# - varcheck ! deprecated since v1.49.0; replaced by 'unused'
|
|
||||||
#- whitespace
|
#- whitespace
|
||||||
fast: false
|
|
||||||
|
|
|
@ -2926,7 +2926,7 @@ func TestHelpFuncExecuted(t *testing.T) {
|
||||||
helpText := "Long description"
|
helpText := "Long description"
|
||||||
|
|
||||||
// Create a context that will be unique, not just the background context
|
// 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")
|
executionCtx := context.WithValue(context.Background(), "testKey", "123")
|
||||||
|
|
||||||
child := &Command{Use: "child", Run: emptyRun}
|
child := &Command{Use: "child", Run: emptyRun}
|
||||||
|
|
|
@ -1297,7 +1297,7 @@ func TestValidArgsFuncCmdContext(t *testing.T) {
|
||||||
}
|
}
|
||||||
rootCmd.AddCommand(childCmd)
|
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")
|
ctx := context.WithValue(context.Background(), "testKey", "123")
|
||||||
|
|
||||||
// Test completing an empty string on the childCmd
|
// Test completing an empty string on the childCmd
|
||||||
|
|
Loading…
Add table
Reference in a new issue