Sha256: ddf3e4f94f64922ff749d42169eabb46d0e36517d0e4ea20d48f148851106652

Contents?: true

Size: 517 Bytes

Versions: 20

Compression:

Stored size: 517 Bytes

Contents

# frozen_string_literal: true

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'

          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

20 entries across 20 versions & 1 rubygems

Version Path
gitlab-styles-7.1.0 lib/gitlab/styles/rubocop/cop/in_batches.rb
gitlab-styles-7.0.0 lib/gitlab/styles/rubocop/cop/in_batches.rb
gitlab-styles-6.6.0 lib/gitlab/styles/rubocop/cop/in_batches.rb
gitlab-styles-6.5.0 lib/gitlab/styles/rubocop/cop/in_batches.rb
gitlab-styles-6.4.0 lib/gitlab/styles/rubocop/cop/in_batches.rb
gitlab-styles-6.3.0 lib/gitlab/styles/rubocop/cop/in_batches.rb
gitlab-styles-6.2.1 lib/gitlab/styles/rubocop/cop/in_batches.rb
gitlab-styles-6.2.0 lib/gitlab/styles/rubocop/cop/in_batches.rb
gitlab-styles-6.1.0 lib/gitlab/styles/rubocop/cop/in_batches.rb
gitlab-styles-6.0.0 lib/gitlab/styles/rubocop/cop/in_batches.rb
gitlab-styles-5.4.0 lib/gitlab/styles/rubocop/cop/in_batches.rb
gitlab-styles-5.3.0 lib/gitlab/styles/rubocop/cop/in_batches.rb
gitlab-styles-5.2.0 lib/gitlab/styles/rubocop/cop/in_batches.rb
gitlab-styles-5.1.0 lib/gitlab/styles/rubocop/cop/in_batches.rb
gitlab-styles-5.0.0 lib/gitlab/styles/rubocop/cop/in_batches.rb
gitlab-styles-4.3.0 lib/gitlab/styles/rubocop/cop/in_batches.rb
gitlab-styles-4.2.0 lib/gitlab/styles/rubocop/cop/in_batches.rb
gitlab-styles-4.1.0 lib/gitlab/styles/rubocop/cop/in_batches.rb
gitlab-styles-4.0.0 lib/gitlab/styles/rubocop/cop/in_batches.rb
gitlab-styles-3.4.0 lib/gitlab/styles/rubocop/cop/in_batches.rb