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
minato_ruby_api_client-0.2.2 vendor/bundle/ruby/3.2.0/gems/rubocop-1.64.1/lib/rubocop/cop/layout/empty_lines_around_method_body.rb
rubocop-1.68.0 lib/rubocop/cop/layout/empty_lines_around_method_body.rb
rubocop-1.67.0 lib/rubocop/cop/layout/empty_lines_around_method_body.rb
rubocop-1.66.1 lib/rubocop/cop/layout/empty_lines_around_method_body.rb
rubocop-1.66.0 lib/rubocop/cop/layout/empty_lines_around_method_body.rb
rubocop-1.65.1 lib/rubocop/cop/layout/empty_lines_around_method_body.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/rubocop-1.64.1/lib/rubocop/cop/layout/empty_lines_around_method_body.rb
rubocop-1.65.0 lib/rubocop/cop/layout/empty_lines_around_method_body.rb
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/rubocop-1.35.1/lib/rubocop/cop/layout/empty_lines_around_method_body.rb
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/rubocop-1.35.1/lib/rubocop/cop/layout/empty_lines_around_method_body.rb
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/rubocop-1.35.1/lib/rubocop/cop/layout/empty_lines_around_method_body.rb
katalyst-govuk-formbuilder-1.9.2 vendor/bundle/ruby/3.3.0/gems/rubocop-1.64.1/lib/rubocop/cop/layout/empty_lines_around_method_body.rb
rubocop-1.64.1 lib/rubocop/cop/layout/empty_lines_around_method_body.rb
rubocop-1.63.4 lib/rubocop/cop/layout/empty_lines_around_method_body.rb
rubocop-1.63.3 lib/rubocop/cop/layout/empty_lines_around_method_body.rb
rubocop-1.63.2 lib/rubocop/cop/layout/empty_lines_around_method_body.rb
harbr-2.8.1 vendor/bundle/ruby/3.2.0/gems/rubocop-1.57.2/lib/rubocop/cop/layout/empty_lines_around_method_body.rb
rubocop-1.63.1 lib/rubocop/cop/layout/empty_lines_around_method_body.rb
rubocop-1.63.0 lib/rubocop/cop/layout/empty_lines_around_method_body.rb
bison-0.1.0 vendor/bundle/ruby/3.2.0/gems/rubocop-1.62.1/lib/rubocop/cop/layout/empty_lines_around_method_body.rb