mirror of
https://github.com/spf13/cobra
synced 2025-06-05 20:07: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
|
||||
cache: true
|
||||
|
||||
- uses: golangci/golangci-lint-action@v4.0.0
|
||||
- uses: golangci/golangci-lint-action@v8.0.0
|
||||
with:
|
||||
version: latest
|
||||
args: --verbose
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue