class Rubydex::LinterConfig
The linterโs settings, read from the [linter] section of the configuration file.
Attributes
rules
[R]
Hash[String, RuleConfig]
The configured rules, keyed by rule name. Only rules the configuration file mentions appear here, so a rule that was never configured is absent rather than present with its defaults.
Public Class Methods
(Hash[String, RuleConfig]) → void
Source
# File lib/rubydex/config.rb, line 13 def initialize(rules) @rules = rules.freeze freeze end
Public Instance Methods
(singleton(Linter::Rule) rule_class) → Array[String]
Source
# File lib/rubydex/config.rb, line 25 def excludes_for(rule_class) @rules[rule_class.rule_name]&.exclude_patterns || [] end
(singleton(Linter::Rule) rule_class) → bool
Source
# File lib/rubydex/config.rb, line 19 def rule_enabled?(rule_class) rule = @rules[rule_class.rule_name] !rule || rule.enabled? end
(singleton(Linter::Rule) rule_class, default: singleton(Severity::Base)) → singleton(Severity::Base)
Source
# File lib/rubydex/config.rb, line 30 def severity_for(rule_class, default:) @rules[rule_class.rule_name]&.severity || default end