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