 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
  
    Index ¶
- Constants
- func IsGoLowerThanGo122() func(cfg *config.Config) error
- func Replacement[T any](replacement string, mgr func(T) any, data T) func(*Deprecation)
- type Config
- func (lc *Config) AllNames() []string
- func (lc *Config) ConsiderSlow() *Config
- func (lc *Config) Deprecated(message, version string, level DeprecationLevel, opts ...func(*Deprecation)) *Config
- func (lc *Config) DeprecatedError(message, version string, opts ...func(*Deprecation)) *Config
- func (lc *Config) DeprecatedWarning(message, version string, opts ...func(*Deprecation)) *Config
- func (lc *Config) FromGroup(name string) bool
- func (lc *Config) IsDeprecated() bool
- func (lc *Config) IsSlowLinter() bool
- func (lc *Config) Name() string
- func (lc *Config) WithAlternativeNames(names ...string) *Config
- func (lc *Config) WithAutoFix() *Config
- func (lc *Config) WithChangeTypes() *Config
- func (lc *Config) WithGroups(names ...string) *Config
- func (lc *Config) WithInternal() *Config
- func (lc *Config) WithLoadFiles() *Config
- func (lc *Config) WithLoadForGoAnalysis() *Config
- func (lc *Config) WithNoopFallback(cfg *config.Config, cond func(cfg *config.Config) error) *Config
- func (lc *Config) WithSince(version string) *Config
- func (lc *Config) WithURL(url string) *Config
 
- type Context
- type Deprecation
- type DeprecationLevel
- type Linter
- type Noop
Constants ¶
      View Source
      
  const LastLinter = "nolintlint"
    LastLinter nolintlint must be last because it looks at the results of all the previous linters for unused nolint directives.
Variables ¶
This section is empty.
Functions ¶
func IsGoLowerThanGo122 ¶
func Replacement ¶ added in v2.2.0
func Replacement[T any](replacement string, mgr func(T) any, data T) func(*Deprecation)
Types ¶
type Config ¶
type Config struct {
	Linter Linter
	Groups map[string]struct{}
	LoadMode packages.LoadMode
	AlternativeNames []string
	OriginalURL     string // URL of original (not forked) repo, needed for autogenerated README
	Internal        bool   // Internal linters cannot be disabled (ex: typecheck).
	CanAutoFix      bool
	IsSlow          bool
	DoesChangeTypes bool
	Since       string
	Deprecation *Deprecation
}
    func (*Config) ConsiderSlow ¶
func (*Config) Deprecated ¶
func (lc *Config) Deprecated(message, version string, level DeprecationLevel, opts ...func(*Deprecation)) *Config
func (*Config) DeprecatedError ¶
func (lc *Config) DeprecatedError(message, version string, opts ...func(*Deprecation)) *Config
func (*Config) DeprecatedWarning ¶
func (lc *Config) DeprecatedWarning(message, version string, opts ...func(*Deprecation)) *Config
func (*Config) IsDeprecated ¶
func (*Config) IsSlowLinter ¶
func (*Config) WithAlternativeNames ¶
func (*Config) WithAutoFix ¶
func (*Config) WithChangeTypes ¶
func (*Config) WithGroups ¶
func (*Config) WithInternal ¶
func (*Config) WithLoadFiles ¶
func (*Config) WithLoadForGoAnalysis ¶
func (*Config) WithNoopFallback ¶
type Context ¶
type Context struct {
	// Packages are deduplicated (test and normal packages) packages
	Packages []*packages.Package
	// OriginalPackages aren't deduplicated: they contain both normal and test
	// version for each of packages
	OriginalPackages []*packages.Package
	Cfg *config.Config
	Log logutils.Log
	PkgCache  *cache.Cache
	LoadGuard *load.Guard
}
    func (*Context) ClearTypesInPackages ¶
func (c *Context) ClearTypesInPackages()
func (*Context) Settings ¶
func (c *Context) Settings() *config.LintersSettings
type Deprecation ¶
type DeprecationLevel ¶
type DeprecationLevel int
const ( DeprecationNone DeprecationLevel = iota DeprecationWarning DeprecationError )
type Noop ¶
type Noop struct {
	// contains filtered or unexported fields
}
    func NewNoopDeprecated ¶
func NewNoopDeprecated(name string, cfg *config.Config, level DeprecationLevel) Noop
 Click to show internal directories. 
   Click to hide internal directories.