Documentation ¶
Overview ¶
Package config defines a filter configuration for nogo findings.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AnalyzerConfig ¶
type AnalyzerConfig map[GroupName]*ItemConfig
AnalyzerConfig is the configuration for a single analyzers.
This map is keyed by individual Group names, to allow for different configurations depending on what Group the file belongs to.
func (AnalyzerConfig) RegexpCount ¶
func (a AnalyzerConfig) RegexpCount() int64
RegexpCount is used by Config.Size.
type Config ¶
type Config struct { // Prefixes defines a set of regular expressions that // are standard "prefixes", so that files can be grouped // and specific rules applied to individual groups. Groups []Group `yaml:"groups"` // Global is the global analyzer config. Global AnalyzerConfig `yaml:"global"` // Analyzers are individual analyzer configurations. The // key for each analyzer is the name of the analyzer. The // value is either a boolean (enable/disable), or a map to // the groups above. Analyzers map[string]AnalyzerConfig `yaml:"analyzers"` }
Config is a nogo configuration.
type Group ¶
type Group struct { // Name is the short name for the group. Name GroupName `yaml:"name"` // Regex matches all full paths in the group. Regex string `yaml:"regex"` // Default determines the default group behavior. // // If Default is true, all Analyzers are enabled for this // group. Otherwise, Analyzers must be individually enabled // by specifying a (possible empty) ItemConfig for the group // in the AnalyzerConfig. Default bool `yaml:"default"` // contains filtered or unexported fields }
Group represents a named collection of files.
type ItemConfig ¶
type ItemConfig struct { // Exclude are analyzer exclusions. // // Exclude is a list of regular expressions. If the corresponding // Analyzer emits a Finding for which Finding.Position.String() // matches a regular expression in Exclude, the finding will not // be reported. Exclude []string `yaml:"exclude,omitempty"` // Suppress are analyzer suppressions. // // Suppress is a list of regular expressions. If the corresponding // Analyzer emits a Finding for which Finding.Message matches a regular // expression in Suppress, the finding will not be reported. Suppress []string `yaml:"suppress,omitempty"` // contains filtered or unexported fields }
ItemConfig is an (Analyzer,Group) configuration.
func (*ItemConfig) RegexpCount ¶
func (i *ItemConfig) RegexpCount() int64
RegexpCount is used by AnalyzerConfig.RegexpCount.
Click to show internal directories.
Click to hide internal directories.