Skip to content

Commit 8003b74

Browse files
authoredMay 19, 2024
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] golangci/golangci-lint#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
1 parent 5c2c1d6 commit 8003b74

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed
 

‎.golangci.yml

+1-4
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,13 @@ linters:
3333
#- gocyclo
3434
#- gofmt
3535
- goimports
36-
- golint
3736
#- gomnd
3837
#- goprintffuncname
3938
#- gosec
4039
- gosimple
4140
- govet
4241
- ineffassign
43-
- interfacer
4442
#- lll
45-
- maligned
4643
- megacheck
4744
#- misspell
4845
#- nakedret
@@ -52,7 +49,7 @@ linters:
5249
#- scopelint
5350
#- staticcheck
5451
#- structcheck ! deprecated since v1.49.0; replaced by 'unused'
55-
#- stylecheck
52+
- stylecheck
5653
#- typecheck
5754
- unconvert
5855
#- unparam

‎command.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -875,7 +875,7 @@ func (c *Command) ArgsLenAtDash() int {
875875

876876
func (c *Command) execute(a []string) (err error) {
877877
if c == nil {
878-
return fmt.Errorf("Called Execute() on a nil Command")
878+
return fmt.Errorf("called Execute() on a nil Command")
879879
}
880880

881881
if len(c.Deprecated) > 0 {

‎completions.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ func (c *Command) getCompletions(args []string) (*Command, []string, ShellCompDi
298298
}
299299
if err != nil {
300300
// Unable to find the real command. E.g., <program> someInvalidCmd <TAB>
301-
return c, []string{}, ShellCompDirectiveDefault, fmt.Errorf("Unable to find a command for arguments: %v", trimmedArgs)
301+
return c, []string{}, ShellCompDirectiveDefault, fmt.Errorf("unable to find a command for arguments: %v", trimmedArgs)
302302
}
303303
finalCmd.ctx = c.ctx
304304

0 commit comments

Comments
 (0)