<commit_before>/* sbt -- Simple Build Tool
 * Copyright 2009  <NAME>
 */

package sbt
package test

import java.io.File
import java.nio.charset.Charset

import xsbt.IPC
import sbt.internal.scripted.{ CommentHandler, FileCommands, ScriptRunner, TestScriptParser }
import sbt.io.{ DirectoryFilter, GlobFilter, HiddenFileFilter, Path }
import sbt.io.IO.wrapNull
import sbt.internal.io.Resources

import sbt.internal.util.{ BufferedLogger, ConsoleLogger, FullLogger }
import sbt.util.{ AbstractLogger, Logger }

import sbt.internal.scripted.TestException

final class ScriptedTests(resourceBaseDirectory: File, bufferLog: Boolean, launcher: File, launchOpts: Seq[String]) {
  import ScriptedTests._
  private val testResources = new Resources(resourceBaseDirectory)

  val ScriptFilename = "test"
  val PendingScriptFilename = "pending"

  def scriptedTest(group: String, name: String, log: xsbti.Logger): Seq[() => Option[String]] =
    scriptedTest(group, name, Logger.xlog2Log(log))
  def scriptedTest(group: String, name: String, log: Logger): Seq[() => Option[String]] =
    scriptedTest(group, name, emptyCallback, log)
  def scriptedTest(group: String, name: String, prescripted: File => Unit, log: Logger): Seq[() => Option[String]] = {
    import Path._
    import GlobFilter._
    var failed = false
    for (groupDir <- (resourceBaseDirectory * group).get; nme <- (groupDir * name).get) yield {
      val g = groupDir.getName
      val n = nme.getName
      val str = s"$g / $n"
      () => {
        println("Running " + str)
        testResources.readWriteResourceDirectory(g, n) { testDirectory =>
          val disabled = new File(testDirectory, "disabled").isFile<commit_msg>Address Codacy's complaints<commit_after>/* sbt -- Simple Build Tool
 * Copyright 2009  <NAME>
 */

package sbt
package test

import java.io.File
import java.nio.charset.Charset

import xsbt.IPC
import sbt.internal.scripted.{ CommentHandler, FileCommands, ScriptRunner, TestScriptParser, TestException }
import sbt.io.{ DirectoryFilter, GlobFilter, HiddenFileFilter, Path }
import sbt.io.IO.wrapNull
import sbt.internal.io.Resources

import sbt.internal.util.{ BufferedLogger, ConsoleLogger, FullLogger }
import sbt.util.{ AbstractLogger, Logger }

final class ScriptedTests(resourceBaseDirectory: File, bufferLog: Boolean, launcher: File, launchOpts: Seq[String]) {
  import ScriptedTests._
  private val testResources = new Resources(resourceBaseDirectory)

  val ScriptFilename = "test"
  val PendingScriptFilename = "pending"

  def scriptedTest(group: String, name: String, log: xsbti.Logger): Seq[() => Option[String]] =
    scriptedTest(group, name, Logger.xlog2Log(log))
  def scriptedTest(group: String, name: String, log: Logger): Seq[() => Option[String]] =
    scriptedTest(group, name, emptyCallback, log)
  def scriptedTest(group: String, name: String, prescripted: File => Unit, log: Logger): Seq[() => Option[String]] = {
    import Path._
    import GlobFilter._
    var failed = false
    for (groupDir <- (resourceBaseDirectory * group).get; nme <- (groupDir * name).get) yield {
      val g = groupDir.getName
      val n = nme.getName
      val str = s"$g / $n"
      () => {
        println("Running " + str)
        testResources.readWriteResourceDirectory(g, n) { testDirectory =>
          val disabled = new File(testDirectory, "disabled").isFile
{'fraction_non_alphanumeric': 0.11759452217922, 'fraction_numerical': 0.002977076510866329, 'mean_word_length': 4.299684542586751, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 17, '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': '933319', 'n_tokens_mistral': 1037, 'n_tokens_neox': 1010, 'n_words': 280}