<commit_before>module Anchorman
  class CLI < Thor

    include Thor::Actions

    desc "generate", "Generates a draft release notes document"

    def generate
      commits = begin
        repo = Git.open('.')
        log = repo.log
        say "#{log.size} commit(s) found"
        log
      rescue ArgumentError
        puts "No git repo found"
      rescue Git::GitExecuteError
        puts "No git log found"
      end

      return unless commits.size

      empty_directory 'anchorman'

      create_file 'anchorman/release_notes.md' do

        "# Release Notes\n #{commits.first.sha}"
      end

    end

  end
end<commit_msg>Refactoring; adding color to output<commit_after>module Anchorman
  class CLI < Thor

    include Thor::Actions

    desc "generate", "Generates a draft release notes document"

    def generate
      commits = get_commits

      return unless commits.size

      empty_directory 'anchorman'

      create_file 'anchorman/release_notes.md' do
        "# Release Notes\n #{commits.first.sha}"
      end

    end

    no_tasks do

      def get_commits
        repo = Git.open('.')
        log = repo.log
        say "#{log.size} commit(s) found", :green
        log
      rescue ArgumentError
        say 'No git repo found', :red
      rescue Git::GitExecuteError
        say 'No git log found', :red
      end

    end
  end
end
{'fraction_non_alphanumeric': 0.07985347985347985, 'fraction_numerical': 0.0, 'mean_word_length': 2.1187214611872145, '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': '2444405', 'n_tokens_mistral': 414, 'n_tokens_neox': 392, 'n_words': 127}