Sha256: 1bf80a35d7c92859c7f2ebf470b0cfcd9c07556665f9a185a7df00f2888ba0a0

Contents?: true

Size: 744 Bytes

Versions: 5

Compression:

Stored size: 744 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

5 entries across 5 versions & 1 rubygems

Version Path
rubocop-0.56.0 lib/rubocop/cop/layout/empty_lines_around_begin_body.rb
rubocop-0.55.0 lib/rubocop/cop/layout/empty_lines_around_begin_body.rb
rubocop-0.54.0 lib/rubocop/cop/layout/empty_lines_around_begin_body.rb
rubocop-0.53.0 lib/rubocop/cop/layout/empty_lines_around_begin_body.rb
rubocop-0.52.1 lib/rubocop/cop/layout/empty_lines_around_begin_body.rb