linter

package
v1.7.2 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2018 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PresetFormatting  = "format"
	PresetComplexity  = "complexity"
	PresetStyle       = "style"
	PresetBugs        = "bugs"
	PresetUnused      = "unused"
	PresetPerformance = "performance"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Linter           Linter
	EnabledByDefault bool
	DoesFullImport   bool
	NeedsSSARepr     bool
	InPresets        []string
	Speed            int // more value means faster execution of linter

	OriginalURL string // URL of original (not forked) repo, needed for autogenerated README
}

func NewConfig

func NewConfig(linter Linter) *Config

func (Config) GetLinter

func (lc Config) GetLinter() Linter

func (Config) GetSpeed

func (lc Config) GetSpeed() int

func (Config) NeedsProgramLoading

func (lc Config) NeedsProgramLoading() bool

func (Config) NeedsSSARepresentation

func (lc Config) NeedsSSARepresentation() bool

func (Config) WithFullImport

func (lc Config) WithFullImport() Config

func (Config) WithPresets

func (lc Config) WithPresets(presets ...string) Config

func (Config) WithSSA

func (lc Config) WithSSA() Config

func (Config) WithSpeed

func (lc Config) WithSpeed(speed int) Config

func (Config) WithURL

func (lc Config) WithURL(url string) Config

type Context

type Context struct {
	PkgProgram           *packages.Program
	Cfg                  *config.Config
	Program              *loader.Program
	SSAProgram           *ssa.Program
	LoaderConfig         *loader.Config
	ASTCache             *astcache.Cache
	NotCompilingPackages []*loader.PackageInfo
	Log                  logutils.Log
}

func (*Context) Settings

func (c *Context) Settings() *config.LintersSettings

type Linter

type Linter interface {
	Run(ctx context.Context, lintCtx *Context) ([]result.Issue, error)
	Name() string
	Desc() string
}

Jump to

Keyboard shortcuts

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