lintersdb

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: GPL-3.0 Imports: 124 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllPresets

func AllPresets() []string

Types

type AnalyzerPlugin

type AnalyzerPlugin interface {
	GetAnalyzers() []*analysis.Analyzer
}

type Builder

type Builder interface {
	Build(cfg *config.Config) ([]*linter.Config, error)
}

type LinterBuilder

type LinterBuilder struct{}

LinterBuilder builds the "internal" linters based on the configuration.

func NewLinterBuilder

func NewLinterBuilder() *LinterBuilder

NewLinterBuilder creates a new LinterBuilder.

func (LinterBuilder) Build

func (LinterBuilder) Build(cfg *config.Config) ([]*linter.Config, error)

Build loads all the "internal" linters. The configuration is use for the linter settings.

type Manager

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

Manager is a type of database for all linters (internals or plugins). It provides methods to access to the linter sets.

func NewManager

func NewManager(log logutils.Log, cfg *config.Config, builders ...Builder) (*Manager, error)

NewManager creates a new Manager. This constructor will call the builders to build and store the linters.

func (*Manager) GetAllEnabledByDefaultLinters

func (m *Manager) GetAllEnabledByDefaultLinters() []*linter.Config

func (*Manager) GetAllLinterConfigsForPreset

func (m *Manager) GetAllLinterConfigsForPreset(p string) []*linter.Config

func (*Manager) GetAllSupportedLinterConfigs

func (m *Manager) GetAllSupportedLinterConfigs() []*linter.Config

func (*Manager) GetEnabledLintersMap

func (m *Manager) GetEnabledLintersMap() (map[string]*linter.Config, error)

func (*Manager) GetLinterConfigs

func (m *Manager) GetLinterConfigs(name string) []*linter.Config

func (*Manager) GetOptimizedLinters

func (m *Manager) GetOptimizedLinters() ([]*linter.Config, error)

GetOptimizedLinters returns enabled linters after optimization (merging) of multiple linters into a fewer number of linters. E.g. some go/analysis linters can be optimized into one metalinter for data reuse and speed up.

type PluginGoBuilder

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

PluginGoBuilder builds the custom linters (Go plugin) based on the configuration.

func NewPluginGoBuilder

func NewPluginGoBuilder(log logutils.Log) *PluginGoBuilder

NewPluginGoBuilder creates new PluginGoBuilder.

func (*PluginGoBuilder) Build

func (b *PluginGoBuilder) Build(cfg *config.Config) ([]*linter.Config, error)

Build loads custom linters that are specified in the golangci-lint config file.

type PluginModuleBuilder

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

PluginModuleBuilder builds the custom linters (module plugin) based on the configuration.

func NewPluginModuleBuilder

func NewPluginModuleBuilder(log logutils.Log) *PluginModuleBuilder

NewPluginModuleBuilder creates new PluginModuleBuilder.

func (*PluginModuleBuilder) Build

func (b *PluginModuleBuilder) Build(cfg *config.Config) ([]*linter.Config, error)

Build loads custom linters that are specified in the golangci-lint config file.

type Validator

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

func NewValidator

func NewValidator(m *Manager) *Validator

func (Validator) Validate

func (v Validator) Validate(cfg *config.Config) error

Validate validates the configuration by calling all other validators for different sections in the configuration and then some additional linter validation functions.

Jump to

Keyboard shortcuts

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