Sha256: 7aa8ae33f4692e0d121b5f0ea92d0a25cf13b5abd4a61987e95f36bbea22857b

Contents?: true

Size: 743 Bytes

Versions: 10

Compression:

Stored size: 743 Bytes

Contents

# frozen_string_literal: true

module RuboCop
  module Cop
    module Layout
      # This cops checks if empty lines exist around the bodies of begin-end
      # blocks.
      #
      # @example
      #
      #   # good
      #
      #   begin
      #     # ...
      #   end
      #
      #   # bad
      #
      #   begin
      #
      #     # ...
      #
      #   end
      class EmptyLinesAroundBeginBody < Cop
        include EmptyLinesAroundBody

        KIND = '`begin`'.freeze

        def on_kwbegin(node)
          check(node, nil)
        end

        def autocorrect(node)
          EmptyLineCorrector.correct(node)
        end

        private

        def style
          :no_empty_lines
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
rubocop-0.59.2 lib/rubocop/cop/layout/empty_lines_around_begin_body.rb
rubocop-0.59.1 lib/rubocop/cop/layout/empty_lines_around_begin_body.rb
rubocop-0.59.0 lib/rubocop/cop/layout/empty_lines_around_begin_body.rb
rubocop-0.58.2 lib/rubocop/cop/layout/empty_lines_around_begin_body.rb
rubocop-0.58.1 lib/rubocop/cop/layout/empty_lines_around_begin_body.rb
rubocop-0.58.0 lib/rubocop/cop/layout/empty_lines_around_begin_body.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/rubocop-0.57.2/lib/rubocop/cop/layout/empty_lines_around_begin_body.rb
rubocop-0.57.2 lib/rubocop/cop/layout/empty_lines_around_begin_body.rb
rubocop-0.57.1 lib/rubocop/cop/layout/empty_lines_around_begin_body.rb
rubocop-0.57.0 lib/rubocop/cop/layout/empty_lines_around_begin_body.rb