<commit_before>import sbt._
import Keys._

import scala.util.Properties.envOrNone

object Http4sBuild extends Build {
  // keys
  val apiVersion = TaskKey[(Int, Int)]("api-version", "Defines the API compatibility version for the project.")
  val jvmTarget = TaskKey[String]("jvm-target-version", "Defines the target JVM version for object files.")

  def extractApiVersion(version: String) = {
    val VersionExtractor = """(\d+)\.(\d+)\..*""".r
    version match {
      case VersionExtractor(major, minor) => (major.toInt, minor.toInt)
    }
  }

  lazy val sonatypeEnvCredentials = (for {
    user <- envOrNone("SONATYPE_USER")
    pass <- envOrNone("SONATYPE_PASS")
  } yield Credentials("Sonatype Nexus Repository Manager", "oss.sonatype.org", user, pass)).toSeq

  def compatibleVersion(version: String, scalazVersion: String) = {
    val currentVersionWithoutSnapshot = version.replaceAll("-SNAPSHOT$", "")
    val (targetMajor, targetMinor) = extractApiVersion(version)
    val targetVersion = scalazCrossBuild(s"${targetMajor}.${targetMinor}.0", scalazVersion)
    if (targetVersion != currentVersionWithoutSnapshot)
      Some(targetVersion)
    else
      None
  }

  val macroParadiseSetting =
    libraryDependencies <++= scalaVersion (
      VersionNumber(_).numbers match {
        case Seq(2, 10, _*) => Seq(
          compilerPlugin("org.scalamacros" % "paradise" % "2.1.0" cross CrossVersion.full),
          "org.scalamacros" %% "quasiquotes" % "2.1.0" cross CrossVersion.binary
        )
        case _ => Seq.empty
      })

  val scalazVersion = settingKey[String]("The version of Scalaz used for building.")
  def scalazCrossBuild(version: String, scalazVersion: String) =
    VersionNumber(scalazVersion).numbers match {
      case Seq(7, 1, _*) =>
        version
      case Seq(7, 2, _*) =>
        if (version.endsWith("-SNAPSHOT"))
          version.replaceFirst("-SNAPSHOT$", "a-SNAPSHOT")
        else
          s"${version}a"
    }
  def specs2Version(scalazVersion: String) =
    VersionNumber(scalazVersion).numbers match {
      case Seq(7, 1, _*) => "3.8.4.1-scalaz-7.1"
      case Seq(7, 2, _*) => "3.8.4"
    }

  lazy val alpnBoot            = "org.mortbay.jetty.alpn"    % "alpn-boot"               % "8.1.9.v20160720"
  def argonaut(scalazVersion: String) = "io.argonaut"       %% "argonaut"                % scalazCrossBuild("6.1", scalazVersion)
  def argonautShapeless(scalazVersion: String) = "com.github.alexarchambault" %% "argonaut-shapeless_6.1" %
    (VersionNumber(scalazVersion).numbers match {
      case Seq(7, 1, _*) => "1.1.0"
      case Seq(7, 2, _*) => "1.1.1"
    })
  lazy val asyncHttpClient     = "org.asynchttpclient"       % "async-http-client"       % "2.0.12"
  lazy val blaze               = "org.http4s"               %% "blaze-http"              % "0.12.0"
  lazy val circeGeneric        = "io.circe"                 %% "circe-generic"           % circeJawn.revision
  lazy val circeJawn           = "io.circe"                 %% "circe-jawn"              % "0.4.1"
  lazy val discipline          = "org.typelevel"            %% "discipline"              % "0.5"
  lazy val gatlingTest         = "io.gatling"                % "gatling-test-framework"  % "2.2.1"
  lazy val gatlingHighCharts   = "io.gatling.highcharts"     % "gatling-charts-highcharts" % gatlingTest.revision<commit_msg>Upgrade to circe-0.5.1<commit_after>import sbt._
import Keys._

import scala.util.Properties.envOrNone

object Http4sBuild extends Build {
  // keys
  val apiVersion = TaskKey[(Int, Int)]("api-version", "Defines the API compatibility version for the project.")
  val jvmTarget = TaskKey[String]("jvm-target-version", "Defines the target JVM version for object files.")

  def extractApiVersion(version: String) = {
    val VersionExtractor = """(\d+)\.(\d+)\..*""".r
    version match {
      case VersionExtractor(major, minor) => (major.toInt, minor.toInt)
    }
  }

  lazy val sonatypeEnvCredentials = (for {
    user <- envOrNone("SONATYPE_USER")
    pass <- envOrNone("SONATYPE_PASS")
  } yield Credentials("Sonatype Nexus Repository Manager", "oss.sonatype.org", user, pass)).toSeq

  def compatibleVersion(version: String, scalazVersion: String) = {
    val currentVersionWithoutSnapshot = version.replaceAll("-SNAPSHOT$", "")
    val (targetMajor, targetMinor) = extractApiVersion(version)
    val targetVersion = scalazCrossBuild(s"${targetMajor}.${targetMinor}.0", scalazVersion)
    if (targetVersion != currentVersionWithoutSnapshot)
      Some(targetVersion)
    else
      None
  }

  val macroParadiseSetting =
    libraryDependencies <++= scalaVersion (
      VersionNumber(_).numbers match {
        case Seq(2, 10, _*) => Seq(
          compilerPlugin("org.scalamacros" % "paradise" % "2.1.0" cross CrossVersion.full),
          "org.scalamacros" %% "quasiquotes" % "2.1.0" cross CrossVersion.binary
        )
        case _ => Seq.empty
      })

  val scalazVersion = settingKey[String]("The version of Scalaz used for building.")
  def scalazCrossBuild(version: String, scalazVersion: String) =
    VersionNumber(scalazVersion).numbers match {
      case Seq(7, 1, _*) =>
        version
      case Seq(7, 2, _*) =>
        if (version.endsWith("-SNAPSHOT"))
          version.replaceFirst("-SNAPSHOT$", "a-SNAPSHOT")
        else
          s"${version}a"
    }
  def specs2Version(scalazVersion: String) =
    VersionNumber(scalazVersion).numbers match {
      case Seq(7, 1, _*) => "3.8.4.1-scalaz-7.1"
      case Seq(7, 2, _*) => "3.8.4"
    }

  lazy val alpnBoot            = "org.mortbay.jetty.alpn"    % "alpn-boot"               % "8.1.9.v20160720"
  def argonaut(scalazVersion: String) = "io.argonaut"       %% "argonaut"                % scalazCrossBuild("6.1", scalazVersion)
  def argonautShapeless(scalazVersion: String) = "com.github.alexarchambault" %% "argonaut-shapeless_6.1" %
    (VersionNumber(scalazVersion).numbers match {
      case Seq(7, 1, _*) => "1.1.0"
      case Seq(7, 2, _*) => "1.1.1"
    })
  lazy val asyncHttpClient     = "org.asynchttpclient"       % "async-http-client"       % "2.0.12"
  lazy val blaze               = "org.http4s"               %% "blaze-http"              % "0.12.0"
  lazy val circeGeneric        = "io.circe"                 %% "circe-generic"           % circeJawn.revision
  lazy val circeJawn           = "io.circe"                 %% "circe-jawn"              % "0.5.1"
  lazy val discipline          = "org.typelevel"            %% "discipline"              % "0.5"
  lazy val gatlingTest         = "io.gatling"                % "gatling-test-framework"  % "2.2.1"
  lazy val gatlingHighCharts   = "io.gatling.highcharts"     % "gatling-charts-highcharts" % gatlingTest.revision
{'fraction_non_alphanumeric': 0.13915761273999108, 'fraction_numerical': 0.02158059235005209, 'mean_word_length': 2.6129032258064515, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '5184849', 'n_tokens_mistral': 2331, 'n_tokens_neox': 2246, 'n_words': 439}