Class: Sloplint::Rule
- Inherits:
-
Data
- Object
- Data
- Sloplint::Rule
- Defined in:
- lib/sloplint/rules.rb
Overview
A rule is data, not code. See docs/SPEC.md "Rule model".
count_group: a Regexp scanned over the matched text to tally items; when set,
the Note carries count and the message may interpolate %count.
skip: Regexps that, if they match the matched text, drop the note (exclusions).
default_on: false keeps a noisy rule out of the default run (still selectable).
Instance Attribute Summary collapse
-
#category ⇒ Object
readonly
Returns the value of attribute category.
-
#count_group ⇒ Object
readonly
Returns the value of attribute count_group.
-
#default_on ⇒ Object
readonly
Returns the value of attribute default_on.
-
#examples_bad ⇒ Object
readonly
Returns the value of attribute examples_bad.
-
#examples_ok ⇒ Object
readonly
Returns the value of attribute examples_ok.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#pattern ⇒ Object
readonly
Returns the value of attribute pattern.
-
#rationale ⇒ Object
readonly
Returns the value of attribute rationale.
-
#severity ⇒ Object
readonly
Returns the value of attribute severity.
-
#skip ⇒ Object
readonly
Returns the value of attribute skip.
-
#suggestion ⇒ Object
readonly
Returns the value of attribute suggestion.
Instance Method Summary collapse
-
#initialize(count_group: nil, skip: [], rationale: nil, default_on: true, **rest) ⇒ Rule
constructor
A new instance of Rule.
Constructor Details
#initialize(count_group: nil, skip: [], rationale: nil, default_on: true, **rest) ⇒ Rule
Returns a new instance of Rule.
14 15 16 |
# File 'lib/sloplint/rules.rb', line 14 def initialize(count_group: nil, skip: [], rationale: nil, default_on: true, **rest) super end |
Instance Attribute Details
#category ⇒ Object (readonly)
Returns the value of attribute category
10 11 12 |
# File 'lib/sloplint/rules.rb', line 10 def category @category end |
#count_group ⇒ Object (readonly)
Returns the value of attribute count_group
10 11 12 |
# File 'lib/sloplint/rules.rb', line 10 def count_group @count_group end |
#default_on ⇒ Object (readonly)
Returns the value of attribute default_on
10 11 12 |
# File 'lib/sloplint/rules.rb', line 10 def default_on @default_on end |
#examples_bad ⇒ Object (readonly)
Returns the value of attribute examples_bad
10 11 12 |
# File 'lib/sloplint/rules.rb', line 10 def examples_bad @examples_bad end |
#examples_ok ⇒ Object (readonly)
Returns the value of attribute examples_ok
10 11 12 |
# File 'lib/sloplint/rules.rb', line 10 def examples_ok @examples_ok end |
#id ⇒ Object (readonly)
Returns the value of attribute id
10 11 12 |
# File 'lib/sloplint/rules.rb', line 10 def id @id end |
#message ⇒ Object (readonly)
Returns the value of attribute message
10 11 12 |
# File 'lib/sloplint/rules.rb', line 10 def @message end |
#pattern ⇒ Object (readonly)
Returns the value of attribute pattern
10 11 12 |
# File 'lib/sloplint/rules.rb', line 10 def pattern @pattern end |
#rationale ⇒ Object (readonly)
Returns the value of attribute rationale
10 11 12 |
# File 'lib/sloplint/rules.rb', line 10 def rationale @rationale end |
#severity ⇒ Object (readonly)
Returns the value of attribute severity
10 11 12 |
# File 'lib/sloplint/rules.rb', line 10 def severity @severity end |
#skip ⇒ Object (readonly)
Returns the value of attribute skip
10 11 12 |
# File 'lib/sloplint/rules.rb', line 10 def skip @skip end |
#suggestion ⇒ Object (readonly)
Returns the value of attribute suggestion
10 11 12 |
# File 'lib/sloplint/rules.rb', line 10 def suggestion @suggestion end |