<commit_before># encoding: utf-8

require 'open3'

module Rubocop
  module Cop
    class LineLength < Cop
      def inspect(file, source, tokens, sexp)
        return unless File.exist?(file)
        _, _, stderr = Open3.popen3('ruby', '-w', '-c', file)

        stderr.each_line do |line|
          line_no, warning = line.match(/.+:(\d+): (.+)/).captures
          add_offence(:warning, line_no.to_i, warning) if line_no
        end
      end
    end
  end
end<commit_msg>Pretty up the display of warnings<commit_after># encoding: utf-8

require 'open3'

module Rubocop
  module Cop
    class LineLength < Cop
      def inspect(file, source, tokens, sexp)
        return unless File.exist?(file)
        _, _, stderr = Open3.popen3('ruby', '-w', '-c', file)

        stderr.each_line do |line|
          line_no, warning = line.match(/.+:(\d+): warning: (.+)/).captures
          add_offence(:warning, line_no.to_i, warning.capitalize) if line_no
        end
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.13157894736842105, 'fraction_numerical': 0.008097165991902834, 'mean_word_length': 2.458041958041958, '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': '325616', 'n_tokens_mistral': 341, 'n_tokens_neox': 330, 'n_words': 89}