github.com/Johnny2210/revive@v1.0.8-0.20210625134200-febf37ccd0f5/lint/config.go (about)

     1  package lint
     2  
     3  // Arguments is type used for the arguments of a rule.
     4  type Arguments = []interface{}
     5  
     6  // RuleConfig is type used for the rule configuration.
     7  type RuleConfig struct {
     8  	Arguments Arguments
     9  	Severity  Severity
    10  	Disabled  bool
    11  }
    12  
    13  // RulesConfig defines the config for all rules.
    14  type RulesConfig = map[string]RuleConfig
    15  
    16  // DirectiveConfig is type used for the linter directive configuration.
    17  type DirectiveConfig struct {
    18  	Severity Severity
    19  }
    20  
    21  // DirectivesConfig defines the config for all directives.
    22  type DirectivesConfig = map[string]DirectiveConfig
    23  
    24  // Config defines the config of the linter.
    25  type Config struct {
    26  	IgnoreGeneratedHeader bool `toml:"ignoreGeneratedHeader"`
    27  	Confidence            float64
    28  	Severity              Severity
    29  	EnableAllRules        bool             `toml:"enableAllRules"`
    30  	Rules                 RulesConfig      `toml:"rule"`
    31  	ErrorCode             int              `toml:"errorCode"`
    32  	WarningCode           int              `toml:"warningCode"`
    33  	Directives            DirectivesConfig `toml:"directive"`
    34  	Exclude               []string         `toml:"exclude"`
    35  }