Sha256: 5efecb11e9629ee8efb870a1da05064304076989066f3da2d30439d16fd68076
Contents?: true
Size: 1005 Bytes
Versions: 62
Compression:
Stored size: 1005 Bytes
Contents
# frozen_string_literal: true module RuboCop module Cop module Style # This cop checks for trailing code after the module definition. # # @example # # bad # module Foo extend self # end # # # good # module Foo # extend self # end # class TrailingBodyOnModule < Cop include Alignment include TrailingBody MSG = 'Place the first line of module body on its own line.' def on_module(node) return unless trailing_body?(node) add_offense(node, location: first_part_of(node.to_a.last)) end def autocorrect(node) lambda do |corrector| LineBreakCorrector.correct_trailing_body( configured_width: configured_indentation_width, corrector: corrector, node: node, processed_source: processed_source ) end end end end end end
Version data entries
62 entries across 43 versions & 5 rubygems