Sha256: 35e8fb1531bccd83a6eabad84dfe61f03dd521312a9af4dff1fb60684da5d4b5

Contents?: true

Size: 699 Bytes

Versions: 2

Compression:

Stored size: 699 Bytes

Contents

# frozen_string_literal: true

module RuboCop
  module Cop
    module Layout
      # This cops checks if empty lines exist around the bodies of methods.
      #
      # @example
      #
      #   # good
      #
      #   def foo
      #     ...
      #   end
      #
      #   # bad
      #
      #   def bar
      #
      #     ...
      #
      #   end
      class EmptyLinesAroundMethodBody < Cop
        include EmptyLinesAroundBody
        include OnMethodDef

        KIND = 'method'.freeze

        def on_method_def(node, _method_name, _args, body)
          check(node, body)
        end

        private

        def style
          :no_empty_lines
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rubocop-0.49.1 lib/rubocop/cop/layout/empty_lines_around_method_body.rb
rubocop-0.49.0 lib/rubocop/cop/layout/empty_lines_around_method_body.rb