Class: Simplabs::Excellent::Checks::ClassNameCheck
- Defined in:
- lib/simplabs/excellent/checks/class_name_check.rb
Overview
This check reports classes with bad names. Badly named classes make reading and understanding the code much harder. Class names regarded as bad are for example:
-
names that are not Pascal cased (camel cased, starting with an upper case letter)
Applies to
-
classes
Constant Summary collapse
- DEFAULT_PATTERN =
/^[A-Z]{1}[a-zA-Z0-9]*$/
Instance Attribute Summary
Attributes inherited from Base
#interesting_files, #interesting_nodes, #warnings
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ ClassNameCheck
constructor
:nodoc:.
Methods inherited from NameCheck
Methods inherited from Base
#add_warning, #evaluate_node, #warnings_for
Constructor Details
#initialize(options = {}) ⇒ ClassNameCheck
:nodoc:
21 22 23 24 |
# File 'lib/simplabs/excellent/checks/class_name_check.rb', line 21 def initialize( = {}) #:nodoc: pattern = [:pattern] || DEFAULT_PATTERN super([:class], pattern) end |