Sha256: 4fc20c710d18961a4e363e26edc5f587da4ef72dd5c681f821acfde00ee74dcb

Contents?: true

Size: 448 Bytes

Versions: 2

Compression:

Stored size: 448 Bytes

Contents

# encoding: utf-8

module Rubocop
  module Cop
    module Lint
      # This cop checks for END blocks in method definitions.
      class EndInMethod < Cop
        include CheckMethods

        MSG = 'END found in method definition. Use `at_exit` instead.'

        private

        def check(node, *_)
          on_node(:postexe, node) do |end_node|
            add_offense(end_node, :keyword)
          end
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rubocop-0.19.1 lib/rubocop/cop/lint/end_in_method.rb
rubocop-0.19.0 lib/rubocop/cop/lint/end_in_method.rb