class Rubydex::Rule
The identity of a rule. We have different mechanisms for collecting diagnostics, but they all share the same fundamental identity: a unique name and a default severity that may be overridden by the userβs configuration.
By keeping this identity concept unified, we are able to treat rules consistently regardless of whether they were collected by the graph during the analysis or by the linter afterwards.
@abstract
Public Class Methods
() → singleton(Severity::Base)
Source
# File lib/rubydex/rule.rb, line 21 def default_severity raise NotImplementedError, "Subclasses must implement the default_severity method" end
@abstract
() → String
Source
# File lib/rubydex/rule.rb, line 14 def rule_name name #: as !nil .split("::").last #: as !nil end
(LinterConfig) → singleton(Severity::Base)
Source
# File lib/rubydex/rule.rb, line 28 def severity(config) config.severity_for(self) || default_severity end
Returns the resolved severity of the rule based on the given configuration.