Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Analyzer = &analysis.Analyzer{ Name: "generatedfileindex", Doc: "indexes generated Go source files for gh-aw custom linters", ResultType: reflect.TypeFor[GeneratedIndex](), RunDespiteErrors: true, Run: func(pass *analysis.Pass) (any, error) { return BuildGeneratedIndex(pass), nil }, }
Analyzer builds a shared generated-file index once per package so analyzers can reuse it via pass.ResultOf.
Functions ¶
func IsGeneratedFile ¶ added in v0.82.10
func IsGeneratedFile(filename string, generated GeneratedIndex) bool
IsGeneratedFile reports whether filename is marked as generated.
func IsTestFile ¶
IsTestFile reports whether filename is a Go test file path.
func ShouldSkipFilename ¶ added in v0.82.10
func ShouldSkipFilename(filename string, generated GeneratedIndex) bool
ShouldSkipFilename reports whether filename should be skipped by linters.
Types ¶
type GeneratedIndex ¶ added in v0.82.10
type GeneratedIndex map[string]struct{}
GeneratedIndex records generated Go source files by filename.
func BuildGeneratedIndex ¶ added in v0.82.10
func BuildGeneratedIndex(pass *analysis.Pass) GeneratedIndex
BuildGeneratedIndex returns the set of generated Go source files in pass.
Click to show internal directories.
Click to hide internal directories.