<commit_before># frozen_string_literal: true

require "rollbar/rails"

Rollbar.configure do |config|
  config.access_token = Rails.application.secrets.rollbar_access_token
  config.enabled = false if Rails.env.development? || Rails.env.test?
  config.exception_level_filters.merge!("ActionController::InvalidCrossOriginRequest" => "ignore",
                                        "ActionController::RoutingError" => "ignore",
                                        "ActionController::UnknownFormat" => "ignore")
  config.js_enabled = true
  config.js_options = {
    accessToken: Rails.application.secrets.rollbar_post_client_item,
    captureUncaught: true,
    payload: { environment: Rails.env }
  }
end<commit_msg>Disable rollbar-js for development and test<commit_after># frozen_string_literal: true

require "rollbar/rails"

def rollbar_enabled?
  Rails.env.staging? || Rails.env.production?
end

Rollbar.configure do |config|
  config.access_token = Rails.application.secrets.rollbar_access_token
  config.enabled = rollbar_enabled?
  config.exception_level_filters.merge!("ActionController::InvalidCrossOriginRequest" => "ignore",
                                        "ActionController::RoutingError" => "ignore",
                                        "ActionController::UnknownFormat" => "ignore")
  config.js_enabled = rollbar_enabled?
  config.js_options = {
    accessToken: Rails.application.secrets.rollbar_post_client_item,
    captureUncaught: true,
    payload: { environment: Rails.env }
  }
end
{'fraction_non_alphanumeric': 0.1013157894736842, 'fraction_numerical': 0.0, 'mean_word_length': 3.3706896551724137, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1856812', 'n_tokens_mistral': 424, 'n_tokens_neox': 411, 'n_words': 70}