Sha256: 4d64b73e40f5ef56357bd9498e63fba2bf90982bc0e29415594133a60bc70391

Contents?: true

Size: 371 Bytes

Versions: 144

Compression:

Stored size: 371 Bytes

Contents

# frozen_string_literal: true

module RuboCop
  module Cop
    module Style
      # Checks for BEGIN blocks.
      #
      # @example
      #   # bad
      #   BEGIN { test }
      #
      class BeginBlock < Base
        MSG = 'Avoid the use of `BEGIN` blocks.'

        def on_preexe(node)
          add_offense(node.loc.keyword)
        end
      end
    end
  end
end

Version data entries

144 entries across 143 versions & 14 rubygems

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