Sha256: 09a9948f0cebc4eecf88fa47a308cf100293ee5a65f464aea6b9a8646fdce1e7

Contents?: true

Size: 697 Bytes

Versions: 73

Compression:

Stored size: 697 Bytes

Contents

# frozen_string_literal: true

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

        KIND = 'method'

        def on_def(node)
          check(node, node.body)
        end
        alias on_defs on_def

        private

        def style
          :no_empty_lines
        end
      end
    end
  end
end

Version data entries

73 entries across 73 versions & 8 rubygems

Version Path
rubocop-1.15.0 lib/rubocop/cop/layout/empty_lines_around_method_body.rb
cocRb-0.1.0 .bundle/ruby/3.0.0/gems/rubocop-1.14.0/lib/rubocop/cop/layout/empty_lines_around_method_body.rb
rubocop-1.14.0 lib/rubocop/cop/layout/empty_lines_around_method_body.rb
rubocop-1.13.0 lib/rubocop/cop/layout/empty_lines_around_method_body.rb
rubocop-1.12.1 lib/rubocop/cop/layout/empty_lines_around_method_body.rb
rubocop-1.12.0 lib/rubocop/cop/layout/empty_lines_around_method_body.rb
rubocop-1.11.0 lib/rubocop/cop/layout/empty_lines_around_method_body.rb
rubocop-1.10.0 lib/rubocop/cop/layout/empty_lines_around_method_body.rb
rubocop-1.9.1 lib/rubocop/cop/layout/empty_lines_around_method_body.rb
rubocop-1.9.0 lib/rubocop/cop/layout/empty_lines_around_method_body.rb
rubocop-1.8.1 lib/rubocop/cop/layout/empty_lines_around_method_body.rb
rubocop-1.8.0 lib/rubocop/cop/layout/empty_lines_around_method_body.rb
rubocop-1.7.0 lib/rubocop/cop/layout/empty_lines_around_method_body.rb
rubocop-1.6.1 lib/rubocop/cop/layout/empty_lines_around_method_body.rb
rubocop-1.6.0 lib/rubocop/cop/layout/empty_lines_around_method_body.rb
rubocop-1.5.2 lib/rubocop/cop/layout/empty_lines_around_method_body.rb
rubocop-1.5.1 lib/rubocop/cop/layout/empty_lines_around_method_body.rb
rubocop-1.5.0 lib/rubocop/cop/layout/empty_lines_around_method_body.rb
rubocop-1.4.2 lib/rubocop/cop/layout/empty_lines_around_method_body.rb
rubocop-1.4.1 lib/rubocop/cop/layout/empty_lines_around_method_body.rb