Skip to content

Commit

Permalink
chore: update
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez committed Apr 11, 2022
1 parent c2d9322 commit d1f4bdb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pkg/commands/help.go
Expand Up @@ -39,7 +39,7 @@ func (e *Executor) initHelp() {

func printLinterConfigs(lcs []*linter.Config) {
sort.Slice(lcs, func(i, j int) bool {
return strings.Compare(lcs[i].Name(), lcs[j].Name()) < 0
return lcs[i].Name() < lcs[j].Name()
})
for _, lc := range lcs {
altNamesStr := ""
Expand Down
2 changes: 1 addition & 1 deletion pkg/golinters/goanalysis/adapters.go
Expand Up @@ -19,7 +19,7 @@ func MakeFakeLoaderProgram(pass *analysis.Pass) *loader.Program {
{
Pkg: pass.Pkg,
Importable: true, // not used
TransitivelyErrorFree: true, // TODO
TransitivelyErrorFree: true, // TODO ???

Files: pass.Files,
Errors: nil,
Expand Down
5 changes: 2 additions & 3 deletions pkg/lint/lintersdb/enabled_set.go
Expand Up @@ -3,7 +3,6 @@ package lintersdb
import (
"os"
"sort"
"strings"

"github.com/golangci/golangci-lint/pkg/config"
"github.com/golangci/golangci-lint/pkg/golinters/goanalysis"
Expand Down Expand Up @@ -123,7 +122,7 @@ func (es EnabledSet) GetOptimizedLinters() ([]*linter.Config, error) {
if a.DoesChangeTypes != b.DoesChangeTypes {
return b.DoesChangeTypes // move type-changing linters to the end to optimize speed
}
return strings.Compare(a.Name(), b.Name()) < 0
return a.Name() < b.Name()
})

return resultLinters, nil
Expand Down Expand Up @@ -168,7 +167,7 @@ func (es EnabledSet) combineGoAnalysisLinters(linters map[string]*linter.Config)
return false
}

return strings.Compare(a.Name(), b.Name()) <= 0
return a.Name() <= b.Name()
})

ml := goanalysis.NewMetaLinter(goanalysisLinters)
Expand Down

0 comments on commit d1f4bdb

Please sign in to comment.