mirror of
https://github.com/spf13/cobra.git
synced 2024-11-15 01:38:17 -07:00
Remove fully inactivated linters (#2148)
* Remove fully inactivated linters Currently golangci-lint fails with these errors: ERRO [linters_context] golint: This linter is fully inactivated: it will not produce any reports. ERRO [linters_context] interfacer: This linter is fully inactivated: it will not produce any reports. ERRO [linters_context] maligned: This linter is fully inactivated: it will not produce any reports. I could not find any docs explaining what "fully inactivated" mean, but based this PR[1] it seems that these linters do nothing now. Removing the linters fixes this issue without changing linting, as they did not produce any report. Looking in the linters docs[2] I did not find a replacement for "interfacer" and "malinged" linters. "stylecheck" seems to be a replacement for "golint", but we need to fix the code to enable it. [1] https://github.com/golangci/golangci-lint/pull/4436 [2] https://golangci-lint.run/usage/linters/ * Add stylecheck linter, replacement for golint This revealed 2 capitalized error messages. https://golangci-lint.run/usage/linters/#stylecheck
This commit is contained in:
parent
5c2c1d627d
commit
8003b74a10
@ -33,16 +33,13 @@ linters:
|
|||||||
#- gocyclo
|
#- gocyclo
|
||||||
#- gofmt
|
#- gofmt
|
||||||
- goimports
|
- goimports
|
||||||
- golint
|
|
||||||
#- gomnd
|
#- gomnd
|
||||||
#- goprintffuncname
|
#- goprintffuncname
|
||||||
#- gosec
|
#- gosec
|
||||||
- gosimple
|
- gosimple
|
||||||
- govet
|
- govet
|
||||||
- ineffassign
|
- ineffassign
|
||||||
- interfacer
|
|
||||||
#- lll
|
#- lll
|
||||||
- maligned
|
|
||||||
- megacheck
|
- megacheck
|
||||||
#- misspell
|
#- misspell
|
||||||
#- nakedret
|
#- nakedret
|
||||||
@ -52,7 +49,7 @@ linters:
|
|||||||
#- scopelint
|
#- scopelint
|
||||||
#- staticcheck
|
#- staticcheck
|
||||||
#- structcheck ! deprecated since v1.49.0; replaced by 'unused'
|
#- structcheck ! deprecated since v1.49.0; replaced by 'unused'
|
||||||
#- stylecheck
|
- stylecheck
|
||||||
#- typecheck
|
#- typecheck
|
||||||
- unconvert
|
- unconvert
|
||||||
#- unparam
|
#- unparam
|
||||||
|
@ -875,7 +875,7 @@ func (c *Command) ArgsLenAtDash() int {
|
|||||||
|
|
||||||
func (c *Command) execute(a []string) (err error) {
|
func (c *Command) execute(a []string) (err error) {
|
||||||
if c == nil {
|
if c == nil {
|
||||||
return fmt.Errorf("Called Execute() on a nil Command")
|
return fmt.Errorf("called Execute() on a nil Command")
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(c.Deprecated) > 0 {
|
if len(c.Deprecated) > 0 {
|
||||||
|
@ -298,7 +298,7 @@ func (c *Command) getCompletions(args []string) (*Command, []string, ShellCompDi
|
|||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// Unable to find the real command. E.g., <program> someInvalidCmd <TAB>
|
// Unable to find the real command. E.g., <program> someInvalidCmd <TAB>
|
||||||
return c, []string{}, ShellCompDirectiveDefault, fmt.Errorf("Unable to find a command for arguments: %v", trimmedArgs)
|
return c, []string{}, ShellCompDirectiveDefault, fmt.Errorf("unable to find a command for arguments: %v", trimmedArgs)
|
||||||
}
|
}
|
||||||
finalCmd.ctx = c.ctx
|
finalCmd.ctx = c.ctx
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user