Sha256: 822137b528ab8f2f482ac1687993ee5bf5e3f21abd5066dacb0e2e99be074c25
Contents?: true
Size: 692 Bytes
Versions: 16
Compression:
Stored size: 692 Bytes
Contents
# frozen_string_literal: true module RuboCop module Cop module Naming # This cops checks for class and module names with # an underscore in them. # # @example # # bad # class My_Class # end # module My_Module # end # # # good # class MyClass # end # module MyModule # end class ClassAndModuleCamelCase < Cop MSG = 'Use CamelCase for classes and modules.'.freeze def on_class(node) return unless node.loc.name.source =~ /_/ add_offense(node, location: :name) end alias on_module on_class end end end end
Version data entries
16 entries across 16 versions & 2 rubygems