package stylecheck
import "honnef.co/go/tools/stylecheck"
Index ¶
- Variables
- func CheckBlankImports(pass *analysis.Pass) (interface{}, error)
- func CheckContextFirstArg(pass *analysis.Pass) (interface{}, error)
- func CheckDefaultCaseOrder(pass *analysis.Pass) (interface{}, error)
- func CheckDotImports(pass *analysis.Pass) (interface{}, error)
- func CheckDuplicatedImports(pass *analysis.Pass) (interface{}, error)
- func CheckErrorReturn(pass *analysis.Pass) (interface{}, error)
- func CheckErrorStrings(pass *analysis.Pass) (interface{}, error)
- func CheckErrorVarNames(pass *analysis.Pass) (interface{}, error)
- func CheckExportedFunctionDocs(pass *analysis.Pass) (interface{}, error)
- func CheckExportedTypeDocs(pass *analysis.Pass) (interface{}, error)
- func CheckExportedVarDocs(pass *analysis.Pass) (interface{}, error)
- func CheckHTTPStatusCodes(pass *analysis.Pass) (interface{}, error)
- func CheckIncDec(pass *analysis.Pass) (interface{}, error)
- func CheckInvisibleCharacters(pass *analysis.Pass) (interface{}, error)
- func CheckNames(pass *analysis.Pass) (interface{}, error)
- func CheckPackageComment(pass *analysis.Pass) (interface{}, error)
- func CheckReceiverNames(pass *analysis.Pass) (interface{}, error)
- func CheckReceiverNamesIdentical(pass *analysis.Pass) (interface{}, error)
- func CheckTimeNames(pass *analysis.Pass) (interface{}, error)
- func CheckUnexportedReturn(pass *analysis.Pass) (interface{}, error)
- func CheckYodaConditions(pass *analysis.Pass) (interface{}, error)
Variables ¶
var Analyzers = lint.InitializeAnalyzers(Docs, map[string]*analysis.Analyzer{ "ST1000": { Run: CheckPackageComment, }, "ST1001": { Run: CheckDotImports, Requires: []*analysis.Analyzer{facts.Generated, config.Analyzer}, }, "ST1003": { Run: CheckNames, Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated, config.Analyzer}, }, "ST1005": { Run: CheckErrorStrings, Requires: []*analysis.Analyzer{buildir.Analyzer}, }, "ST1006": { Run: CheckReceiverNames, Requires: []*analysis.Analyzer{buildir.Analyzer, facts.Generated}, }, "ST1008": { Run: CheckErrorReturn, Requires: []*analysis.Analyzer{buildir.Analyzer}, }, "ST1011": { Run: CheckTimeNames, Requires: []*analysis.Analyzer{inspect.Analyzer}, }, "ST1012": { Run: CheckErrorVarNames, }, "ST1013": { Run: CheckHTTPStatusCodes, Requires: []*analysis.Analyzer{facts.Generated, facts.TokenFile, config.Analyzer, inspect.Analyzer}, }, "ST1015": { Run: CheckDefaultCaseOrder, Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated, facts.TokenFile}, }, "ST1016": { Run: CheckReceiverNamesIdentical, Requires: []*analysis.Analyzer{buildir.Analyzer, facts.Generated}, }, "ST1017": { Run: CheckYodaConditions, Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated, facts.TokenFile}, }, "ST1018": { Run: CheckInvisibleCharacters, Requires: []*analysis.Analyzer{inspect.Analyzer}, }, "ST1019": { Run: CheckDuplicatedImports, Requires: []*analysis.Analyzer{facts.Generated}, }, "ST1020": { Run: CheckExportedFunctionDocs, Requires: []*analysis.Analyzer{facts.Generated, inspect.Analyzer}, }, "ST1021": { Run: CheckExportedTypeDocs, Requires: []*analysis.Analyzer{facts.Generated, inspect.Analyzer}, }, "ST1022": { Run: CheckExportedVarDocs, Requires: []*analysis.Analyzer{facts.Generated, inspect.Analyzer}, }, })
var Docs = map[string]*lint.Documentation{ "ST1000": { Title: `Incorrect or missing package comment`, Text: "" /* 167 byte string literal not displayed */, Since: "2019.1", NonDefault: true, }, "ST1001": { Title: `Dot imports are discouraged`, Text: "" /* 898 byte string literal not displayed */, Since: "2019.1", Options: []string{"dot_import_whitelist"}, }, "ST1003": { Title: `Poorly chosen identifier`, Text: "" /* 359 byte string literal not displayed */, Since: "2019.1", NonDefault: true, Options: []string{"initialisms"}, }, "ST1005": { Title: `Incorrectly formatted error string`, Text: "" /* 497 byte string literal not displayed */, Since: "2019.1", }, "ST1006": { Title: `Poorly chosen receiver name`, Text: "" /* 749 byte string literal not displayed */, Since: "2019.1", }, "ST1008": { Title: `A function's error value should be its last return value`, Text: `A function's error value should be its last return value.`, Since: `2019.1`, }, "ST1011": { Title: `Poorly chosen name for variable of type time.Duration`, Text: "" /* 280 byte string literal not displayed */, Since: `2019.1`, }, "ST1012": { Title: `Poorly chosen name for error variable`, Text: `Error variables that are part of an API should be called errFoo or ErrFoo.`, Since: "2019.1", }, "ST1013": { Title: `Should use constants for HTTP error codes, not magic numbers`, Text: "" /* 359 byte string literal not displayed */, Since: "2019.1", Options: []string{"http_status_code_whitelist"}, }, "ST1015": { Title: `A switch's default case should be the first or last case`, Since: "2019.1", }, "ST1016": { Title: `Use consistent method receiver names`, Since: "2019.1", NonDefault: true, }, "ST1017": { Title: `Don't use Yoda conditions`, Text: "" /* 324 byte string literal not displayed */, Since: "2019.2", }, "ST1018": { Title: `Avoid zero-width and control characters in string literals`, Since: "2019.2", }, "ST1019": { Title: `Importing the same package multiple times`, Text: "" /* 689 byte string literal not displayed */, Since: "2020.1", }, "ST1020": { Title: "The documentation of an exported function should start with the function's name", Text: "" /* 458 byte string literal not displayed */, Since: "2020.1", NonDefault: true, }, "ST1021": { Title: "The documentation of an exported type should start with type's name", Text: "" /* 458 byte string literal not displayed */, Since: "2020.1", NonDefault: true, }, "ST1022": { Title: "The documentation of an exported variable or constant should start with variable's name", Text: "" /* 458 byte string literal not displayed */, Since: "2020.1", NonDefault: true, }, }
Functions ¶
func CheckBlankImports ¶
func CheckContextFirstArg ¶
func CheckDefaultCaseOrder ¶
func CheckDotImports ¶
func CheckDuplicatedImports ¶
func CheckErrorReturn ¶
func CheckErrorStrings ¶
func CheckErrorVarNames ¶
func CheckExportedFunctionDocs ¶
func CheckExportedTypeDocs ¶
func CheckExportedVarDocs ¶
func CheckHTTPStatusCodes ¶
func CheckIncDec ¶
func CheckInvisibleCharacters ¶
func CheckNames ¶
func CheckPackageComment ¶
func CheckReceiverNames ¶
func CheckReceiverNamesIdentical ¶
func CheckTimeNames ¶
func CheckUnexportedReturn ¶
CheckUnexportedReturn checks that exported functions on exported types do not return unexported types.
func CheckYodaConditions ¶
Source Files ¶
analysis.go doc.go lint.go names.go
- Version
- v0.1.2
- Published
- Feb 19, 2021
- Platform
- linux/amd64
- Imports
- 26 packages
- Last checked
- 25 seconds ago –
Tools for package owners.