Class: RuboCop::Cop::Kata::RealWords
- Inherits:
-
Base
- Object
- Base
- RuboCop::Cop::Kata::RealWords
- Defined in:
- lib/rubocop/cop/kata/real_words.rb
Constant Summary collapse
- MSG =
"%s is not in the dictionary — restore the underscore between smashed words, spell the " \ "abbreviation out, or add it to `Terms` if it is one domain term here."
- ABBREVIATION_MSG =
"%s is an abbreviation; spell the word out."- SIGIL =
/\A(@@|@|\$)/- DERIVATIONS =
[ [/s\z/, ""], [/es\z/, ""], [/ies\z/, "y"], [/able\z/, ""], [/able\z/, "e"], [/([b-df-hj-np-tv-z])\1able\z/, '\1'], [/er\z/, ""], [/[eo]r\z/, "e"], [/ier\z/, "y"], [/([b-df-hj-np-tv-z])\1er\z/, '\1'], [/or\z/, ""], [/less\z/, ""] ].freeze
Instance Method Summary collapse
- #on_arg(node) ⇒ Object
- #on_cvasgn(node) ⇒ Object
- #on_def(node) ⇒ Object
- #on_defs(node) ⇒ Object
- #on_gvasgn(node) ⇒ Object
- #on_ivasgn(node) ⇒ Object
- #on_kwarg(node) ⇒ Object
- #on_kwoptarg(node) ⇒ Object
- #on_lvasgn(node) ⇒ Object
- #on_optarg(node) ⇒ Object
Instance Method Details
#on_arg(node) ⇒ Object
27 |
# File 'lib/rubocop/cop/kata/real_words.rb', line 27 def on_arg(node) = check(node, node.name) |
#on_cvasgn(node) ⇒ Object
23 |
# File 'lib/rubocop/cop/kata/real_words.rb', line 23 def on_cvasgn(node) = check(node, node.name) |
#on_def(node) ⇒ Object
15 |
# File 'lib/rubocop/cop/kata/real_words.rb', line 15 def on_def(node) = check(node, node.method_name) |
#on_defs(node) ⇒ Object
17 |
# File 'lib/rubocop/cop/kata/real_words.rb', line 17 def on_defs(node) = check(node, node.method_name) |
#on_gvasgn(node) ⇒ Object
25 |
# File 'lib/rubocop/cop/kata/real_words.rb', line 25 def on_gvasgn(node) = check(node, node.name) |
#on_ivasgn(node) ⇒ Object
21 |
# File 'lib/rubocop/cop/kata/real_words.rb', line 21 def on_ivasgn(node) = check(node, node.name) |
#on_kwarg(node) ⇒ Object
31 |
# File 'lib/rubocop/cop/kata/real_words.rb', line 31 def on_kwarg(node) = check(node, node.name) |
#on_kwoptarg(node) ⇒ Object
33 |
# File 'lib/rubocop/cop/kata/real_words.rb', line 33 def on_kwoptarg(node) = check(node, node.name) |
#on_lvasgn(node) ⇒ Object
19 |
# File 'lib/rubocop/cop/kata/real_words.rb', line 19 def on_lvasgn(node) = check(node, node.name) |
#on_optarg(node) ⇒ Object
29 |
# File 'lib/rubocop/cop/kata/real_words.rb', line 29 def on_optarg(node) = check(node, node.name) |