<commit_before># encoding: utf-8

module Rubocop
  module Cop
    class AvoidFor < Cop
      MSG = 'Prefer *each* over *for*.'

      def inspect(file, source, tokens, ast)
        on_node(:for, ast) do |node|
          add_offence(:convention,
                      node.src.keyword.line,
                      MSG)
        end
      end
    end
  end
end<commit_msg>Port AvoidFor cop to AST::Processor<commit_after># encoding: utf-8

module Rubocop
  module Cop
    class AvoidFor < Cop
      MSG = 'Prefer *each* over *for*.'

      def inspect(file, source, tokens, ast)
        process(ast)
      end

      def on_for(node)
        add_offence(:convention,
                    node.src.keyword.line,
                    MSG)
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.08970976253298153, 'fraction_numerical': 0.002638522427440633, 'mean_word_length': 1.6819787985865724, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4983802', 'n_tokens_mistral': 243, 'n_tokens_neox': 230, 'n_words': 66}