<commit_before>package models.actions

import models.GitHubAction
import github.GitHubAPI
import github.GitHubEvent
import github.events.PullRequestEvent
import github.events.IssueCommentEvent
import github.enums.PullRequestAction


class FixMeAction extends GitHubAction {
  def isMatch(msg: GitHubEvent): Boolean = {
    msg.name == "issue_comment"
  }
  def process(api: GitHubAPI, msg: GitHubEvent): Unit = {
    val (text, number, opener) = msg match {
      case x: IssueCommentEvent => (
        x.comment.body, 
        x.issue.number,
        x.issue.user.name
      )
    }
println("test1: " + text)
    text.split("\n").map(_.split("[\t\r\n\\., ]")).filter { words =>
println("test1.5: [" + words.mkString("***") + "]")
      val fix = words.indexOf("fix")
      val me = words.indexOf("me")
println("test2: " + fix + ", " + me)
      fix >= 0 && me == fix + 1
    }.headOption.foreach { words =>
      val assignee = words.find(_.startsWith("@")).map(_.substring(1)).getOrElse(opener)
println("test3: " + assignee)
      api.addLabels(number, "Fix me!")
      api.removeLabel(number, "Review me!")
      api.assign(number, assignee)
    }
  }
}<commit_msg>Remove debug log<commit_after>package models.actions

import models.GitHubAction
import github.GitHubAPI
import github.GitHubEvent
import github.events.PullRequestEvent
import github.events.IssueCommentEvent
import github.enums.PullRequestAction


class FixMeAction extends GitHubAction {
  def isMatch(msg: GitHubEvent): Boolean = {
    msg.name == "issue_comment"
  }
  def process(api: GitHubAPI, msg: GitHubEvent): Unit = {
    val (text, number, opener) = msg match {
      case x: IssueCommentEvent => (
        x.comment.body, 
        x.issue.number,
        x.issue.user.name
      )
    }
    text.split("\n").map(_.split("[\t\r\n\\., ]")).filter { words =>
      val fix = words.indexOf("fix")
      val me = words.indexOf("me")
      fix >= 0 && me == fix + 1
    }.headOption.foreach { words =>
      val assignee = words.find(_.startsWith("@")).map(_.substring(1)).getOrElse(opener)
      api.addLabels(number, "Fix me!")
      api.removeLabel(number, "Review me!")
      api.assign(number, assignee)
    }
  }
}
{'fraction_non_alphanumeric': 0.1536007292616226, 'fraction_numerical': 0.005013673655423883, 'mean_word_length': 3.1571969696969697, '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': '1992093', 'n_tokens_mistral': 753, 'n_tokens_neox': 704, 'n_words': 149}