Documentation ¶
Index ¶
- Variables
- func FindOffset(fileText string, line, column int) int
- func FormatCode(code string) string
- func GetPackageName(imports []*ast.ImportSpec, path, defaultName string) string
- func MakeFakeLoaderPackageInfo(pass *analysis.Pass) *loader.PackageInfo
- func ReadFile(fset *token.FileSet, filename string) ([]byte, *token.File, error)
- func SkipAnalyzer(analyzer *analysis.Analyzer)
- func SkipAnalyzerByConfig(analyzer *analysis.Analyzer)
- type Directive
Constants ¶
This section is empty.
Variables ¶
View Source
var Directives = &analysis.Analyzer{ Name: "directives", Doc: "extracts linter directives", Run: doDirectives, RunDespiteErrors: true, ResultType: reflect.TypeOf([]Directive{}), }
Directives is a fact that contains a list of directives.
Functions ¶
func FindOffset ¶
FindOffset returns the offset of a given position in a file.
func GetPackageName ¶
func GetPackageName(imports []*ast.ImportSpec, path, defaultName string) string
GetPackageName returns the package name used in this file.
func MakeFakeLoaderPackageInfo ¶
func MakeFakeLoaderPackageInfo(pass *analysis.Pass) *loader.PackageInfo
MakeFakeLoaderPackageInfo creates a fake loader.PackageInfo for a given package.
func ReadFile ¶
ReadFile reads a file and adds it to the FileSet so that we can report errors against it using lineStart.
func SkipAnalyzer ¶
SkipAnalyzer updates an analyzer from `staticcheck` and `golangci-linter` to make it work on nogo. They have "lint:ignore" or "nolint" to make the analyzer ignore the code.
func SkipAnalyzerByConfig ¶
SkipAnalyzerByConfig updates an analyzer to skip files according to `exclude_files`
Types ¶
Click to show internal directories.
Click to hide internal directories.