<commit_before>import com.typesafe.sbt.JavaVersionCheckPlugin.autoImport._
import com.typesafe.sbt.SbtGit.GitKeys
import com.typesafe.sbt.osgi.{OsgiKeys, SbtOsgi}
import com.typesafe.sbt.pgp.PgpKeys
import sbtbuildinfo.{BuildInfoPlugin, BuildInfoKeys}
import sbtbuildinfo.BuildInfoPlugin.autoImport.BuildInfoKey
import sbtunidoc.ScalaUnidocPlugin.autoImport.ScalaUnidoc
import sbtunidoc.BaseUnidocPlugin.autoImport._
import xerial.sbt.Sonatype
import Sonatype.SonatypeKeys
import sbt._
import Keys._

/** Build support settings and functions. */
object ScalateBuild {

  implicit final class ScalateProjectSyntax(val u: Project) extends AnyVal {

    def scalateBaseSettings = u.settings(projectOpts: _*)

    def scalateSettings = scalateBaseSettings
      .enablePlugins(BuildInfoPlugin)
      .settings(compileOpts ++ updateOpts ++ docOpts ++ buildInfoOpts ++ testOpts: _*)

    def osgiSettings = u.enablePlugins(SbtOsgi).settings(osgiOpts: _*)

    def dependsOn(deps: ModuleID*) = u.settings(libraryDependencies ++= deps)

    def published = u.settings(publishOpts: _*)

    def notPublished = u.settings(ScalateBuild.notPublished: _*)
  }

  def scalateProject(id: String, base: Option[File] = None): Project =
    Project(s"scalate-$id", base.getOrElse(file(s"scalate-$id")))

  def addScalaModules(scalaMajor: Int, modules: (String => ModuleID)*) = libraryDependencies := {
    CrossVersion.partialVersion(scalaVersion.value) match {
      case Some((2, v)) if v >= scalaMajor => libraryDependencies.value ++ modules.map(_(scalaOrganization.value))
      case _ => libraryDependencies.value
    }
  }

  def addScalaDependentDeps(modules: (Int, ModuleID)*) = libraryDependencies := {
    val sv = CrossVersion.partialVersion(scalaVersion.value).map(_._2).get
    libraryDependencies.value ++ modules.collect { case m if m._1 == sv => m._2 }
  }

  def notPublished = Seq(
    publishArtifact := false,
    publish := (),
    publishLocal := (),
    PgpKeys.publishLocalSigned := (),
    PgpKeys.publishSigned := (),
    publishTo := Some(Resolver.file("file",  target.value / "m2-cache/"))
  )

  def unidocOpts(filter: ProjectReference*): Seq[Setting[_]] =
    inConfig(ScalaUnidoc)(inTask(unidoc)(docOptsBase)) ++ Seq(
    scalacOptions in ThisBuild ++= Seq("-sourcepath", (baseDirectory in LocalRootProject).value.getAbsolutePath),
    apiMappings in ThisBuild += (scalaInstance.value.libraryJar →
      url(s"http://www.scala-lang.org/api/${scalaVersion.value}/")),
    unidocProjectFilter in(ScalaUnidoc, unidoc) :=
      inAnyProject -- inProjects(filter: _*))

  private def projectOpts = Seq(
    name := name(_.split("-|(?<!(^|[A-Z]))(?=[A-Z])|(?<!^)(?=[A-Z][a-z])").map(_.capitalize).mkString(" ")).value,
    version := (version in LocalRootProject).value,<commit_msg>fix "adaptation of argument list" warnings<commit_after>import com.typesafe.sbt.JavaVersionCheckPlugin.autoImport._
import com.typesafe.sbt.SbtGit.GitKeys
import com.typesafe.sbt.osgi.{OsgiKeys, SbtOsgi}
import com.typesafe.sbt.pgp.PgpKeys
import sbtbuildinfo.{BuildInfoPlugin, BuildInfoKeys}
import sbtbuildinfo.BuildInfoPlugin.autoImport.BuildInfoKey
import sbtunidoc.ScalaUnidocPlugin.autoImport.ScalaUnidoc
import sbtunidoc.BaseUnidocPlugin.autoImport._
import xerial.sbt.Sonatype
import Sonatype.SonatypeKeys
import sbt._
import Keys._

/** Build support settings and functions. */
object ScalateBuild {

  implicit final class ScalateProjectSyntax(val u: Project) extends AnyVal {

    def scalateBaseSettings = u.settings(projectOpts: _*)

    def scalateSettings = scalateBaseSettings
      .enablePlugins(BuildInfoPlugin)
      .settings(compileOpts ++ updateOpts ++ docOpts ++ buildInfoOpts ++ testOpts: _*)

    def osgiSettings = u.enablePlugins(SbtOsgi).settings(osgiOpts: _*)

    def dependsOn(deps: ModuleID*) = u.settings(libraryDependencies ++= deps)

    def published = u.settings(publishOpts: _*)

    def notPublished = u.settings(ScalateBuild.notPublished: _*)
  }

  def scalateProject(id: String, base: Option[File] = None): Project =
    Project(s"scalate-$id", base.getOrElse(file(s"scalate-$id")))

  def addScalaModules(scalaMajor: Int, modules: (String => ModuleID)*) = libraryDependencies := {
    CrossVersion.partialVersion(scalaVersion.value) match {
      case Some((2, v)) if v >= scalaMajor => libraryDependencies.value ++ modules.map(_(scalaOrganization.value))
      case _ => libraryDependencies.value
    }
  }

  def addScalaDependentDeps(modules: (Int, ModuleID)*) = libraryDependencies := {
    val sv = CrossVersion.partialVersion(scalaVersion.value).map(_._2).get
    libraryDependencies.value ++ modules.collect { case m if m._1 == sv => m._2 }
  }

  def notPublished = Seq(
    publishArtifact := false,
    publish := {},
    publishLocal := {},
    PgpKeys.publishLocalSigned := {},
    PgpKeys.publishSigned := {},
    publishTo := Some(Resolver.file("file",  target.value / "m2-cache/"))
  )

  def unidocOpts(filter: ProjectReference*): Seq[Setting[_]] =
    inConfig(ScalaUnidoc)(inTask(unidoc)(docOptsBase)) ++ Seq(
    scalacOptions in ThisBuild ++= Seq("-sourcepath", (baseDirectory in LocalRootProject).value.getAbsolutePath),
    apiMappings in ThisBuild += (scalaInstance.value.libraryJar →
      url(s"http://www.scala-lang.org/api/${scalaVersion.value}/")),
    unidocProjectFilter in(ScalaUnidoc, unidoc) :=
      inAnyProject -- inProjects(filter: _*))

  private def projectOpts = Seq(
    name := name(_.split("-|(?<!(^|[A-Z]))(?=[A-Z])|(?<!^)(?=[A-Z][a-z])").map(_.capitalize).mkString(" ")).value,
    version := (version in LocalRootProject).value,
{'fraction_non_alphanumeric': 0.14053861244872481, 'fraction_numerical': 0.0017834849295523454, 'mean_word_length': 4.722448979591837, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '6244016', 'n_tokens_mistral': 1890, 'n_tokens_neox': 1816, 'n_words': 322}