Class: Simplabs::Excellent::Checks::ModuleNameCheck

Inherits:
NameCheck
  • Object
show all
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_contexts, #interesting_files, #options, #warnings

Instance Method Summary collapse

Methods inherited from NameCheck

#evaluate

Methods inherited from Base

#add_warning, #evaluate_context, #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(options = {}) #:nodoc:
  options[:pattern] ||= DEFAULT_PATTERN
  super([Parsing::ModuleContext], options)
end