VictoriaMetrics/vendor/honnef.co/go/tools/simple/analysis.go

149 lines
4.2 KiB
Go
Raw Normal View History

package simple
import (
"golang.org/x/tools/go/analysis"
"golang.org/x/tools/go/analysis/passes/inspect"
"honnef.co/go/tools/facts"
2020-02-26 19:46:17 +01:00
"honnef.co/go/tools/internal/passes/buildir"
"honnef.co/go/tools/lint/lintutil"
)
2020-02-26 19:46:17 +01:00
var Analyzers = lintutil.InitializeAnalyzers(Docs, map[string]*analysis.Analyzer{
"S1000": {
2020-02-26 19:46:17 +01:00
Run: CheckSingleCaseSelect,
Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},
},
"S1001": {
2020-02-26 19:46:17 +01:00
Run: CheckLoopCopy,
Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},
},
"S1002": {
2020-02-26 19:46:17 +01:00
Run: CheckIfBoolCmp,
Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},
},
"S1003": {
2020-02-26 19:46:17 +01:00
Run: CheckStringsContains,
Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},
},
"S1004": {
2020-02-26 19:46:17 +01:00
Run: CheckBytesCompare,
Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},
},
"S1005": {
2020-02-26 19:46:17 +01:00
Run: CheckUnnecessaryBlank,
Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},
},
"S1006": {
2020-02-26 19:46:17 +01:00
Run: CheckForTrue,
Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},
},
"S1007": {
2020-02-26 19:46:17 +01:00
Run: CheckRegexpRaw,
Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},
},
"S1008": {
2020-02-26 19:46:17 +01:00
Run: CheckIfReturn,
Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},
},
"S1009": {
2020-02-26 19:46:17 +01:00
Run: CheckRedundantNilCheckWithLen,
Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},
},
"S1010": {
2020-02-26 19:46:17 +01:00
Run: CheckSlicing,
Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},
},
"S1011": {
2020-02-26 19:46:17 +01:00
Run: CheckLoopAppend,
Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},
},
"S1012": {
2020-02-26 19:46:17 +01:00
Run: CheckTimeSince,
Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},
},
"S1016": {
2020-02-26 19:46:17 +01:00
Run: CheckSimplerStructConversion,
Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},
},
"S1017": {
2020-02-26 19:46:17 +01:00
Run: CheckTrim,
Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},
},
"S1018": {
2020-02-26 19:46:17 +01:00
Run: CheckLoopSlide,
Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},
},
"S1019": {
2020-02-26 19:46:17 +01:00
Run: CheckMakeLenCap,
Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},
},
"S1020": {
2020-02-26 19:46:17 +01:00
Run: CheckAssertNotNil,
Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},
},
"S1021": {
2020-02-26 19:46:17 +01:00
Run: CheckDeclareAssign,
Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},
},
"S1023": {
2020-02-26 19:46:17 +01:00
Run: CheckRedundantBreak,
Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},
},
"S1024": {
2020-02-26 19:46:17 +01:00
Run: CheckTimeUntil,
Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},
},
"S1025": {
2020-02-26 19:46:17 +01:00
Run: CheckRedundantSprintf,
Requires: []*analysis.Analyzer{buildir.Analyzer, inspect.Analyzer, facts.Generated},
},
"S1028": {
2020-02-26 19:46:17 +01:00
Run: CheckErrorsNewSprintf,
Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},
},
"S1029": {
2020-02-26 19:46:17 +01:00
Run: CheckRangeStringRunes,
Requires: []*analysis.Analyzer{buildir.Analyzer},
},
"S1030": {
2020-02-26 19:46:17 +01:00
Run: CheckBytesBufferConversions,
Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},
},
"S1031": {
2020-02-26 19:46:17 +01:00
Run: CheckNilCheckAroundRange,
Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},
},
"S1032": {
2020-02-26 19:46:17 +01:00
Run: CheckSortHelpers,
Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},
},
"S1033": {
2020-02-26 19:46:17 +01:00
Run: CheckGuardedDelete,
Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},
},
"S1034": {
2020-02-26 19:46:17 +01:00
Run: CheckSimplifyTypeSwitch,
Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},
},
"S1035": {
Run: CheckRedundantCanonicalHeaderKey,
Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},
},
"S1036": {
Run: CheckUnnecessaryGuard,
Requires: []*analysis.Analyzer{inspect.Analyzer},
},
"S1037": {
Run: CheckElaborateSleep,
Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},
},
"S1038": {
Run: CheckPrintSprintf,
Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},
},
"S1039": {
Run: CheckSprintLiteral,
Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},
},
2020-02-26 19:46:17 +01:00
})