goanalysis

package
v1.19.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 23, 2019 License: GPL-3.0 Imports: 30 Imported by: 0

Documentation

Overview

Package checker defines the implementation of the checker commands. The same code drives the multi-analysis driver, the single-analysis driver that is conventionally provided for convenience along with each analysis package, and the test driver.

Index

Constants

This section is empty.

Variables

View Source
var (
	Debug = os.Getenv("GL_GOANALYSIS_DEBUG")
)

Functions

func NeedFacts added in v1.19.0

func NeedFacts(analyzers []*analysis.Analyzer) bool

NeedFacts reports whether any analysis required by the specified set needs facts. If so, we must load the entire program from source.

Types

type Diagnostic added in v1.19.0

type Diagnostic struct {
	analysis.Diagnostic
	Analyzer *analysis.Analyzer
	Position token.Position
}

type Fact added in v1.19.0

type Fact struct {
	Path string // non-empty only for object facts
	Fact analysis.Fact
}

type Linter

type Linter struct {
	// contains filtered or unexported fields
}

func NewLinter

func NewLinter(name, desc string, analyzers []*analysis.Analyzer, cfg map[string]map[string]interface{}) *Linter

func (Linter) AnalyzerToLinterNameMapping added in v1.19.0

func (lnt Linter) AnalyzerToLinterNameMapping() map[*analysis.Analyzer]string

func (Linter) Analyzers added in v1.19.0

func (lnt Linter) Analyzers() []*analysis.Analyzer

func (Linter) Cfg added in v1.19.0

func (lnt Linter) Cfg() map[string]map[string]interface{}

func (Linter) Desc

func (lnt Linter) Desc() string

func (Linter) Name

func (lnt Linter) Name() string

func (Linter) Run

func (lnt Linter) Run(ctx context.Context, lintCtx *linter.Context) ([]result.Issue, error)

type MetaLinter added in v1.19.0

type MetaLinter struct {
	// contains filtered or unexported fields
}

func NewMetaLinter added in v1.19.0

func NewMetaLinter(linters []*Linter, analyzerToLinterName map[*analysis.Analyzer]string) *MetaLinter

func (MetaLinter) Desc added in v1.19.0

func (ml MetaLinter) Desc() string

func (MetaLinter) Name added in v1.19.0

func (ml MetaLinter) Name() string

func (MetaLinter) Run added in v1.19.0

func (ml MetaLinter) Run(ctx context.Context, lintCtx *linter.Context) ([]result.Issue, error)

type SupportedLinter added in v1.19.0

type SupportedLinter interface {
	Analyzers() []*analysis.Analyzer
	Cfg() map[string]map[string]interface{}
	AnalyzerToLinterNameMapping() map[*analysis.Analyzer]string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL