Sha256: a32c1dc37fed9abe3bb8efcbfb6b4db505e5daba1205d90e061aff39a1636f18

Contents?: true

Size: 493 Bytes

Versions: 19

Compression:

Stored size: 493 Bytes

Contents

require_relative '../model_helpers'

module Gitlab
  module Styles
    module Rubocop
      module Cop
        # Cop that prevents the use of `in_batches`
        class InBatches < RuboCop::Cop::Cop
          MSG = 'Do not use `in_batches`, use `each_batch` from the EachBatch module instead'.freeze

          def on_send(node)
            return unless node.children[1] == :in_batches

            add_offense(node, location: :selector)
          end
        end
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
gitlab-styles-3.3.0 lib/gitlab/styles/rubocop/cop/in_batches.rb
gitlab-styles-3.2.0 lib/gitlab/styles/rubocop/cop/in_batches.rb
gitlab-styles-3.1.0 lib/gitlab/styles/rubocop/cop/in_batches.rb
gitlab-styles-3.0.0 lib/gitlab/styles/rubocop/cop/in_batches.rb
gitlab-styles-2.8.0 lib/gitlab/styles/rubocop/cop/in_batches.rb
gitlab-styles-2.7.0 lib/gitlab/styles/rubocop/cop/in_batches.rb
gitlab-styles-2.6.2 lib/gitlab/styles/rubocop/cop/in_batches.rb
gitlab-styles-2.6.1 lib/gitlab/styles/rubocop/cop/in_batches.rb
gitlab-styles-2.6.0 lib/gitlab/styles/rubocop/cop/in_batches.rb
gitlab-styles-2.5.2 lib/gitlab/styles/rubocop/cop/in_batches.rb
gitlab-styles-2.5.1 lib/gitlab/styles/rubocop/cop/in_batches.rb
gitlab-styles-2.5.0 lib/gitlab/styles/rubocop/cop/in_batches.rb
gitlab-styles-2.4.1 lib/gitlab/styles/rubocop/cop/in_batches.rb
gitlab-styles-2.4.0 lib/gitlab/styles/rubocop/cop/in_batches.rb
gitlab-styles-2.3.2 lib/gitlab/styles/rubocop/cop/in_batches.rb
gitlab-styles-2.3.1 lib/gitlab/styles/rubocop/cop/in_batches.rb
gitlab-styles-2.3.0 lib/gitlab/styles/rubocop/cop/in_batches.rb
gitlab-styles-2.2.0 lib/gitlab/styles/rubocop/cop/in_batches.rb
gitlab-styles-2.1.0 lib/gitlab/styles/rubocop/cop/in_batches.rb