<commit_before>require 'octokit'

module Pronto
  module Formatter
    class GithubFormatter
      attr_writer :client

      def format(messages)
        messages.each do |message|
          @client.create_commit_comment(github_slug(message),
                                        sha(message),
                                        message.msg,
                                        message.path,
                                        message.line.new_lineno)
        end
      end

      private

      def github_slug(message)
        message.repo.remotes.map(&:github_slug).compact.first
      end

      def sha(message)
        blamelines = blame(message).lines
        lineno = message.line.new_lineno

        blameline = blamelines.detect { |line| line.lineno == lineno }
<commit_msg>Info message for GithubFormatter as output instead of messages instances<commit_after>require 'octokit'

module Pronto
  module Formatter
    class GithubFormatter
      attr_writer :client

      def format(messages)
        messages.each do |message|
          @client.create_commit_comment(github_slug(message),
                                        sha(message),
                                        message.msg,
                                        message.path,
                                        message.line.new_lineno)
        end

        "#{messages.count} pronto messages posted to GitHub"
      end

      private

      def github_slug(message)
        message.repo.remotes.map(&:github_slug).compact.first
      end

      def sha(message)
        blamelines = blame(message).lines
        lineno = message.line.new_lineno

        blameline = blamelines.detect { |line| line.lineno == lineno }

{'fraction_non_alphanumeric': 0.06840579710144927, 'fraction_numerical': 0.0, 'mean_word_length': 1.5014492753623188, 'pattern_counts': {'":': 0, '<': 3, '<?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': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '513406', 'n_tokens_mistral': 429, 'n_tokens_neox': 413, 'n_words': 91}