Sha256: 3c399d6bc62532c1835057fad4fa107372704b0abb3617bc971b060af7e1c260

Contents?: true

Size: 688 Bytes

Versions: 187

Compression:

Stored size: 688 Bytes

Contents

# frozen_string_literal: true

module RuboCop
  module Cop
    module Layout
      # 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

187 entries across 180 versions & 18 rubygems

Version Path
rubocop-1.62.1 lib/rubocop/cop/layout/empty_lines_around_method_body.rb
rubocop-1.62.0 lib/rubocop/cop/layout/empty_lines_around_method_body.rb
rubocop-1.61.0 lib/rubocop/cop/layout/empty_lines_around_method_body.rb
mlh-rubocop-config-1.0.3 vendor/bundle/ruby/3.2.0/gems/rubocop-1.60.2/lib/rubocop/cop/layout/empty_lines_around_method_body.rb
rubocop-1.60.2 lib/rubocop/cop/layout/empty_lines_around_method_body.rb
study_line-0.2.7 vendor/bundle/ruby/3.2.0/gems/rubocop-1.60.0/lib/rubocop/cop/layout/empty_lines_around_method_body.rb
study_line-0.2.6 vendor/bundle/ruby/3.2.0/gems/rubocop-1.60.0/lib/rubocop/cop/layout/empty_lines_around_method_body.rb
study_line-0.2.5 vendor/bundle/ruby/3.2.0/gems/rubocop-1.60.0/lib/rubocop/cop/layout/empty_lines_around_method_body.rb
study_line-0.2.4 vendor/bundle/ruby/3.2.0/gems/rubocop-1.60.0/lib/rubocop/cop/layout/empty_lines_around_method_body.rb
study_line-0.2.3 vendor/bundle/ruby/3.2.0/gems/rubocop-1.60.0/lib/rubocop/cop/layout/empty_lines_around_method_body.rb
study_line-0.2.2 vendor/bundle/ruby/3.2.0/gems/rubocop-1.60.0/lib/rubocop/cop/layout/empty_lines_around_method_body.rb
rubocop-1.60.1 lib/rubocop/cop/layout/empty_lines_around_method_body.rb
study_line-0.2.1 vendor/bundle/ruby/3.2.0/gems/rubocop-1.60.0/lib/rubocop/cop/layout/empty_lines_around_method_body.rb
study_line-0.2.0 vendor/bundle/ruby/3.2.0/gems/rubocop-1.60.0/lib/rubocop/cop/layout/empty_lines_around_method_body.rb
rubocop-1.60.0 lib/rubocop/cop/layout/empty_lines_around_method_body.rb
harbr-0.2.10 vendor/bundle/ruby/3.2.0/gems/rubocop-1.57.2/lib/rubocop/cop/layout/empty_lines_around_method_body.rb
harbr-0.2.9 vendor/bundle/ruby/3.2.0/gems/rubocop-1.57.2/lib/rubocop/cop/layout/empty_lines_around_method_body.rb
harbr-0.2.8 vendor/bundle/ruby/3.2.0/gems/rubocop-1.57.2/lib/rubocop/cop/layout/empty_lines_around_method_body.rb
harbr-0.2.7 vendor/bundle/ruby/3.2.0/gems/rubocop-1.57.2/lib/rubocop/cop/layout/empty_lines_around_method_body.rb
harbr-0.2.6 vendor/bundle/ruby/3.2.0/gems/rubocop-1.57.2/lib/rubocop/cop/layout/empty_lines_around_method_body.rb