Sha256: 3d7b61ec69fbb0fe14253431a4a9e5c142af639a935fa2ee63b863299cd02fe0
Contents?: true
Size: 675 Bytes
Versions: 11
Compression:
Stored size: 675 Bytes
Contents
# encoding: utf-8 module RuboCop module Cop module Style # This cops checks for use of `extend self` in a module. # # @example # # module Test # extend self # # ... # end class ModuleFunction < Cop MSG = 'Use `module_function` instead of `extend self`.' TARGET_NODE = s(:send, nil, :extend, s(:self)) def on_module(node) _name, body = *node return unless body && body.type == :begin body.children.each do |body_node| add_offense(body_node, :expression) if body_node == TARGET_NODE end end end end end end
Version data entries
11 entries across 11 versions & 2 rubygems