<commit_before>require 'fitting/cover/json_schema'
require 'fitting/report/prefixes'
require 'fitting/report/tests'
require 'fitting/report/console'

namespace :fitting do
  task :report do
    tests = Fitting::Report::Tests.new_from_config
    prefixes = Fitting::Report::Prefixes.new(Fitting.configuration.prefixes)

    tests.to_a.map do |test|
      prefix = prefixes.find!(test)
      prefix.mark!(test)

      action = prefix.actions.find!(test)
      action.mark!(test)

      response = action.responses.find!(test)
      response.mark!(test)

      combination = response.combinations.find!(test)
      combination.mark!(test)
      print "\e[32m.\e[0m"
    rescue Fitting::Report::Combinations::Empty,
      Fitting::Report::Combinations::NotFound,
      Fitting::Report::Actions::Empty
    end

    console = Fitting::Report::Console.new(
      tests.without_prefixes,
      prefixes.to_a.map(&:details)
    )

    puts
    puts
    exit 1 unless console.good?

    exit 0
  end
end<commit_msg>use yellow star<commit_after>require 'fitting/cover/json_schema'
require 'fitting/report/prefixes'
require 'fitting/report/tests'
require 'fitting/report/console'

namespace :fitting do
  task :report do
    tests = Fitting::Report::Tests.new_from_config
    prefixes = Fitting::Report::Prefixes.new(Fitting.configuration.prefixes)

    tests.to_a.map do |test|
      prefix = prefixes.find!(test)
      prefix.mark!(test)

      action = prefix.actions.find!(test)
      action.mark!(test)

      response = action.responses.find!(test)
      response.mark!(test)

      combination = response.combinations.find!(test)
      combination.mark!(test)
      print "\e[32m.\e[0m"
    rescue  Fitting::Report::Actions::Empty
      print "\e[33m*\e[0m"
    rescue Fitting::Report::Combinations::Empty,
      Fitting::Report::Combinations::NotFound
    end

    console = Fitting::Report::Console.new(
      tests.without_prefixes,
      prefixes.to_a.map(&:details)
    )

    puts
    puts
    exit 1 unless console.good?

    exit 0
  end
end
{'fraction_non_alphanumeric': 0.12524461839530332, 'fraction_numerical': 0.006360078277886497, 'mean_word_length': 3.3603411513859274, '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': '774272', 'n_tokens_mistral': 667, 'n_tokens_neox': 644, 'n_words': 112}