<commit_before>require "tmpdir"
require "securerandom"
require "json"
require "digest/sha1"

require "code_climate/test_reporter/exception_message"

module CodeClimate
  module TestReporter
    class Formatter
      def format(result)
        print "Coverage = #{result.covered_percent.round(2)}%."

        payload = to_payload(result)
        if tddium? || ENV["TO_FILE"]
          file_path = File.join(Dir.tmpdir, "codeclimate-test-coverage-#{SecureRandom.uuid}.json")
          print "Coverage results saved to #{file_path}..."<commit_msg>Better spacing for text output<commit_after>require "tmpdir"
require "securerandom"
require "json"
require "digest/sha1"

require "code_climate/test_reporter/exception_message"

module CodeClimate
  module TestReporter
    class Formatter
      def format(result)
        print "Coverage = #{result.covered_percent.round(2)}%. "

        payload = to_payload(result)
        if tddium? || ENV["TO_FILE"]
          file_path = File.join(Dir.tmpdir, "codeclimate-test-coverage-#{SecureRandom.uuid}.json")
          print "Coverage results saved to #{file_path}... "
{'fraction_non_alphanumeric': 0.11562782294489611, 'fraction_numerical': 0.0036133694670280035, 'mean_word_length': 3.755364806866953, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7648978', 'n_tokens_mistral': 356, 'n_tokens_neox': 345, 'n_words': 73}