<commit_before># Container module for GitHub webhook events
module GitHub::EventMessages
  def self.suppressed_actions
    %w{commit_comment create deployment fork issues issue_comment \
       member membership pull_request_review_comment release repository \
       team_add watch}
  end

  # rubocop:disable Metrics/CyclomaticComplexity
  def self.handler_for(event_type, body)
    case event_type
    when "create"
      GitHub::EventMessages::Create.new(body)
    when "delete"
      GitHub::EventMessages::Delete.new(body)
    when "ping"
      GitHub::EventMessages::Ping.new(body)
    when "push"
      GitHub::EventMessages::Push.new(body)
    when "pull_request"
      GitHub::EventMessages::PullRequest.new(body)
    when "status"
      GitHub::EventMessages::Status.new(body)
    when "deployment_status"
      GitHub::EventMessages::DeploymentStatus.new(body)
    when *suppressed_actions
      nil
    else
      GitHub::EventMessages::Unknown.new(body, event_type)
    end
  end
  # rubocop:enable Metrics/CyclomaticComplexity<commit_msg>don't suppress create actions<commit_after># Container module for GitHub webhook events
module GitHub::EventMessages
  def self.suppressed_actions
    %w{commit_comment deployment fork issues issue_comment \
       member membership pull_request_review_comment release repository \
       team_add watch}
  end

  # rubocop:disable Metrics/CyclomaticComplexity
  def self.handler_for(event_type, body)
    case event_type
    when "create"
      GitHub::EventMessages::Create.new(body)
    when "delete"
      GitHub::EventMessages::Delete.new(body)
    when "ping"
      GitHub::EventMessages::Ping.new(body)
    when "push"
      GitHub::EventMessages::Push.new(body)
    when "pull_request"
      GitHub::EventMessages::PullRequest.new(body)
    when "status"
      GitHub::EventMessages::Status.new(body)
    when "deployment_status"
      GitHub::EventMessages::DeploymentStatus.new(body)
    when *suppressed_actions
      nil
    else
      GitHub::EventMessages::Unknown.new(body, event_type)
    end
  end
  # rubocop:enable Metrics/CyclomaticComplexity
{'fraction_non_alphanumeric': 0.08936170212765958, 'fraction_numerical': 0.0, 'mean_word_length': 4.026128266033254, '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': '653411', 'n_tokens_mistral': 639, 'n_tokens_neox': 621, 'n_words': 127}