Sha256: 0f2debe8f943dd8d9179c4602365b07d8cd144075a5c18c84c33db6e0a763e27

Contents?: true

Size: 824 Bytes

Versions: 16

Compression:

Stored size: 824 Bytes

Contents

# encoding: utf-8

module RuboCop
  module Cop
    module Style
      # This cops checks if empty lines around the bodies of methods match
      # the configuration.
      #
      # @example
      #
      #   def something(arg)
      #
      #     ...
      #   end
      #
      class EmptyLinesAroundMethodBody < Cop
        include EmptyLinesAroundBody
        include OnMethodDef

        KIND = 'method'

        private

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

        # Override ConfigurableEnforcedStyle#style and hard-code
        # configuration. It's difficult to imagine that anybody would want
        # empty lines around a method body, so we don't make it configurable.
        def style
          :no_empty_lines
        end
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
rubocop-0.35.1 lib/rubocop/cop/style/empty_lines_around_method_body.rb
rubocop-0.35.0 lib/rubocop/cop/style/empty_lines_around_method_body.rb
rubocop-0.34.2 lib/rubocop/cop/style/empty_lines_around_method_body.rb
rubocop-0.34.1 lib/rubocop/cop/style/empty_lines_around_method_body.rb
rubocop-0.34.0 lib/rubocop/cop/style/empty_lines_around_method_body.rb
rubocop-0.33.0 lib/rubocop/cop/style/empty_lines_around_method_body.rb
rubocop-0.32.1 lib/rubocop/cop/style/empty_lines_around_method_body.rb
rubocop-0.32.0 lib/rubocop/cop/style/empty_lines_around_method_body.rb
rubocop-0.31.0 lib/rubocop/cop/style/empty_lines_around_method_body.rb
rubocop-0.30.1 lib/rubocop/cop/style/empty_lines_around_method_body.rb
rubocop-0.30.0 lib/rubocop/cop/style/empty_lines_around_method_body.rb
rubocop-0.29.1 lib/rubocop/cop/style/empty_lines_around_method_body.rb
rubocop-0.29.0 lib/rubocop/cop/style/empty_lines_around_method_body.rb
rubocop-0.28.0 lib/rubocop/cop/style/empty_lines_around_method_body.rb
rubocop-0.27.1 lib/rubocop/cop/style/empty_lines_around_method_body.rb
rubocop-0.27.0 lib/rubocop/cop/style/empty_lines_around_method_body.rb