Sha256: aabbfb75a420d3ecf3607a05f90bea391a57f2c53eba5a498d1043aff0113394
Contents?: true
Size: 874 Bytes
Versions: 12
Compression:
Stored size: 874 Bytes
Contents
require 'simplabs/excellent/checks/base' module Simplabs module Excellent module Checks # 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 class ModuleNameCheck < NameCheck DEFAULT_PATTERN = /^[A-Z][a-zA-Z0-9]*$/ def initialize(options = {}) #:nodoc: pattern = options['pattern'] || DEFAULT_PATTERN super([:module], pattern) end protected def warning_args(context) #:nodoc: [context, 'Bad module name {{module}}.', { :module => context.full_name }] end end end end end
Version data entries
12 entries across 12 versions & 2 rubygems