<commit_before>require 'tempfile'

require 'simplecov'
require 'coveralls'

if SimpleCov.usable?
  if defined?(TracePoint)
    require_relative 'racc_coverage_helper'

    RaccCoverage.start(%w(ruby18.y ruby19.y),
                       File.expand_path('../../lib/parser', __FILE__))

    # Report results faster.
    at_exit { RaccCoverage.stop }
  end

  require 'simplecov-sublime-ruby-coverage'

  SimpleCov.start do
    self.formatter = SimpleCov::Formatter::MultiFormatter[
      SimpleCov::Formatter::HTMLFormatter,
      SimpleCov::Formatter::SublimeRubyCoverageFormatter,
      Coveralls::SimpleCov::Formatter
    ]

    add_group "Grammars" do |source_file|
      source_file.filename =~ %r{\.y$}
    end

    # Exclude the testsuite itself.
    add_filter "/test/"

    # Exclude generated files.
    add_filter do |source_file|<commit_msg>ruby20.y: compute coverage.<commit_after>require 'tempfile'

require 'simplecov'
require 'coveralls'

if SimpleCov.usable?
  if defined?(TracePoint)
    require_relative 'racc_coverage_helper'

    RaccCoverage.start(%w(ruby18.y ruby19.y ruby20.y),
                       File.expand_path('../../lib/parser', __FILE__))

    # Report results faster.
    at_exit { RaccCoverage.stop }
  end

  require 'simplecov-sublime-ruby-coverage'

  SimpleCov.start do
    self.formatter = SimpleCov::Formatter::MultiFormatter[
      SimpleCov::Formatter::HTMLFormatter,
      SimpleCov::Formatter::SublimeRubyCoverageFormatter,
      Coveralls::SimpleCov::Formatter
    ]

    add_group "Grammars" do |source_file|
      source_file.filename =~ %r{\.y$}
    end

    # Exclude the testsuite itself.
    add_filter "/test/"

    # Exclude generated files.
    add_filter do |source_file|
{'fraction_non_alphanumeric': 0.11117544875506659, 'fraction_numerical': 0.006948465547191662, 'mean_word_length': 3.3526448362720402, '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': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3253691', 'n_tokens_mistral': 591, 'n_tokens_neox': 547, 'n_words': 102}