<commit_before>package org.softwaremill.clippy

sealed trait CompilationError
case class TypeMismatchError(found: String, required: String) extends CompilationError

object CompilationErrorParser {
  private val FoundRegexp = """found\s*:\s*([^\n]+)\n""".r
  private val RequiredRegexp = """required:\s*(.+)""".r

  def parse(error: String): Option[CompilationError] = {
    if (error.startsWith("type mismatch")) {
      for {
        found <- FoundRegexp.findFirstMatchIn(error)
        required <- RequiredRegexp.findFirstMatchIn(error)
      } yield TypeMismatchError(found.group(1), required.group(1))
    }
    else None
  }
}
<commit_msg>Allow optional spaces in pattern<commit_after>package org.softwaremill.clippy

sealed trait CompilationError
case class TypeMismatchError(found: String, required: String) extends CompilationError

object CompilationErrorParser {
  private val FoundRegexp = """found\s*:\s*([^\n]+)\n""".r
  private val RequiredRegexp = """required\s*:\s*(.+)""".r

  def parse(error: String): Option[CompilationError] = {
    if (error.startsWith("type mismatch")) {
      for {
        found <- FoundRegexp.findFirstMatchIn(error)
        required <- RequiredRegexp.findFirstMatchIn(error)
      } yield TypeMismatchError(found.group(1), required.group(1))
    }
    else None
  }
}

{'fraction_non_alphanumeric': 0.13414634146341464, 'fraction_numerical': 0.003048780487804878, 'mean_word_length': 4.294354838709677, 'pattern_counts': {'":': 0, '<': 7, '<?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': '1219508', 'n_tokens_mistral': 410, 'n_tokens_neox': 399, 'n_words': 84}