Sha256: 107a34b0dad35e719a808a8ffdad133696ec26eddd0672f184363c74b7146702

Contents?: true

Size: 311 Bytes

Versions: 4

Compression:

Stored size: 311 Bytes

Contents

# encoding: utf-8

module Rubocop
  module Cop
    module Style
      # This cop looks for uses of the *for* keyword.
      class AvoidFor < Cop
        MSG = 'Prefer *each* over *for*.'

        def on_for(node)
          add_offence(:convention, node.loc.keyword, MSG)
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rubocop-0.12.0 lib/rubocop/cop/style/avoid_for.rb
rubocop-0.11.1 lib/rubocop/cop/style/avoid_for.rb
rubocop-0.11.0 lib/rubocop/cop/style/avoid_for.rb
rubocop-0.10.0 lib/rubocop/cop/style/avoid_for.rb