<commit_before>
require 'rib'

module Rib::StripBacktrace
  extend Rib::Plugin
  Shell.use(self)

  # --------------- Rib API ---------------

  # strip backtrace until rib
  def format_error err
    return super if StripBacktrace.disabled?
    backtrace = if err.kind_of?(SyntaxError)
                  []
                else
                  err.backtrace
                end
    message, backtrace = get_error(err)
    "#{message}\n  #{backtrace.join("\n  ")}"
  end

  # --------------- Plugin API ---------------

  def get_error err
    return super if StripBacktrace.disabled?
    ["#{err.class}: #{err.message}", strip_backtrace(err.backtrace)]
  end<commit_msg>i don't remember the rationale behind this...<commit_after>
require 'rib'

module Rib::StripBacktrace
  extend Rib::Plugin
  Shell.use(self)

  # --------------- Rib API ---------------

  # strip backtrace until rib
  def format_error err
    return super if StripBacktrace.disabled?
    message, backtrace = get_error(err)
    "#{message}\n  #{backtrace.join("\n  ")}"
  end

  # --------------- Plugin API ---------------

  def get_error err
    return super if StripBacktrace.disabled?
    ["#{err.class}: #{err.message}", strip_backtrace(err.backtrace)]
  end
{'fraction_non_alphanumeric': 0.19563459983831852, 'fraction_numerical': 0.0, 'mean_word_length': 1.9759615384615385, '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': '5426426', 'n_tokens_mistral': 373, 'n_tokens_neox': 353, 'n_words': 91}