<commit_before>require 'spec/rake/verify_rcov'

namespace :spec do
  Spec::Rake::SpecTask.new(:rcov) do |t|
    t.spec_files = FileList['spec/**/*_spec.rb']
    t.spec_opts = ['--color', '--format', 'specdoc']
    t.rcov = true
    t.rcov_opts = [
      '--exclude', 'spec',
      '--exclude', '1\\.8\\/gems',
      '--exclude', '1\\.9\\/gems'
    ]
  end

  RCov::VerifyTask.new(:verify) do |t| 
    t.threshold = 100.0
    t.index_html = 'coverage/index.html'
  end

  task :verify => :rcov

  desc "Generate HTML Specdocs for all specs"
  Spec::Rake::SpecTask.new(:specdoc) do |t|
    specdoc_path = File.expand_path(
      File.join(File.dirname(__FILE__), '../specdoc/'))
    Dir.mkdir(specdoc_path) if !File.exist?(specdoc_path)
    
    output_file = File.join(specdoc_path, 'index.html')
    t.spec_files = FileList['spec/**/*_spec.rb']
    t.spec_opts = ["--format", "\"html:#{output_file}\"", "--diff"]
    t.fail_on_error = false
  end  

  desc "Browse the code coverage report."
  task :rcov_browse => :rcov do
    Rake.browse("coverage/index.html")
  end
end

desc "Alias to spec:verify"
task "spec" => "spec:verify"

task "clobber" => ["spec:clobber_rcov"]<commit_msg>Renamed rcov browse task.<commit_after>require 'spec/rake/verify_rcov'

namespace :spec do
  Spec::Rake::SpecTask.new(:rcov) do |t|
    t.spec_files = FileList['spec/**/*_spec.rb']
    t.spec_opts = ['--color', '--format', 'specdoc']
    t.rcov = true
    t.rcov_opts = [
      '--exclude', 'spec',
      '--exclude', '1\\.8\\/gems',
      '--exclude', '1\\.9\\/gems'
    ]
  end

  RCov::VerifyTask.new(:verify) do |t| 
    t.threshold = 100.0
    t.index_html = 'coverage/index.html'
  end

  task :verify => :rcov

  desc "Generate HTML Specdocs for all specs"
  Spec::Rake::SpecTask.new(:specdoc) do |t|
    specdoc_path = File.expand_path(
      File.join(File.dirname(__FILE__), '../specdoc/'))
    Dir.mkdir(specdoc_path) if !File.exist?(specdoc_path)
    
    output_file = File.join(specdoc_path, 'index.html')
    t.spec_files = FileList['spec/**/*_spec.rb']
    t.spec_opts = ["--format", "\"html:#{output_file}\"", "--diff"]
    t.fail_on_error = false
  end  

  namespace :rcov do
    desc "Browse the code coverage report."
    task :browse => "spec:rcov" do
      Rake.browse("coverage/index.html")
    end
  end
end

desc "Alias to spec:verify"
task "spec" => "spec:verify"

task "clobber" => ["spec:clobber_rcov"]
{'fraction_non_alphanumeric': 0.1872410936205468, 'fraction_numerical': 0.006628003314001657, 'mean_word_length': 3.072512647554806, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '6134386', 'n_tokens_mistral': 954, 'n_tokens_neox': 921, 'n_words': 180}