Skip to content

Commit

Permalink
Change to use non-unicode arrows
Browse files Browse the repository at this point in the history
  • Loading branch information
Viktor Lövgren committed May 16, 2017
1 parent 3f39b0d commit 00434cc
Show file tree
Hide file tree
Showing 38 changed files with 285 additions and 285 deletions.
20 changes: 10 additions & 10 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,11 @@ lazy val docs = project
organization,
latestVersion in ThisBuild,
crossScalaVersions,
BuildInfoKey.map(moduleName in coreJVM) { case (k, v) "core" + k.capitalize -> v },
BuildInfoKey.map(moduleName in enumeratumJVM) { case (k, v) "enumeratum" + k.capitalize -> v },
BuildInfoKey.map(moduleName in genericJVM) { case (k, v) "generic" + k.capitalize -> v },
BuildInfoKey.map(moduleName in refinedJVM) { case (k, v) "refined" + k.capitalize -> v },
BuildInfoKey.map(moduleName in squantsJVM) { case (k, v) "squants" + k.capitalize -> v }
BuildInfoKey.map(moduleName in coreJVM) { case (k, v) => "core" + k.capitalize -> v },
BuildInfoKey.map(moduleName in enumeratumJVM) { case (k, v) => "enumeratum" + k.capitalize -> v },
BuildInfoKey.map(moduleName in genericJVM) { case (k, v) => "generic" + k.capitalize -> v },
BuildInfoKey.map(moduleName in refinedJVM) { case (k, v) => "refined" + k.capitalize -> v },
BuildInfoKey.map(moduleName in squantsJVM) { case (k, v) => "squants" + k.capitalize -> v }
)
)
.dependsOn(coreJVM, enumeratumJVM, genericJVM, refinedJVM, squantsJVM)
Expand Down Expand Up @@ -141,9 +141,9 @@ lazy val scalaSettings = Seq(
"-Ywarn-unused-import",
"-Ywarn-unused"
).filter {
case "-Ywarn-unused-import" if scalaVersion.value == scala210 false
case "-Ywarn-unused" if scalaVersion.value != scala212 false
case _ true
case "-Ywarn-unused-import" if scalaVersion.value == scala210 => false
case "-Ywarn-unused" if scalaVersion.value != scala212 => false
case _ => true
},
scalacOptions in (Compile, console) -= "-Ywarn-unused-import",
scalacOptions in (Test, console) := (scalacOptions in (Compile, console)).value
Expand Down Expand Up @@ -252,7 +252,7 @@ generateReadme in ThisBuild := {
val updateReadme = taskKey[Unit]("Generates and commits the readme")
updateReadme in ThisBuild := {
(generateReadme in ThisBuild).value
sbtrelease.Vcs.detect((baseDirectory in ciris).value).foreach { vcs
sbtrelease.Vcs.detect((baseDirectory in ciris).value).foreach { vcs =>
vcs.add("readme.md").!
vcs.commit("Update readme to latest version", sign = true).!
}
Expand Down Expand Up @@ -292,7 +292,7 @@ generateScripts in ThisBuild := {
val updateScripts = taskKey[Unit]("Generates and commits scripts")
updateScripts in ThisBuild := {
(generateScripts in ThisBuild).value
sbtrelease.Vcs.detect((baseDirectory in ciris).value).foreach { vcs
sbtrelease.Vcs.detect((baseDirectory in ciris).value).foreach { vcs =>
vcs.add(scriptsDirectory).!
vcs.commit("Update scripts to latest version", sign = true).!
}
Expand Down
8 changes: 4 additions & 4 deletions modules/core/js/src/test/scala/ciris/CirisJsSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ final class CirisJsSpec extends PropertySpec {
"being used in a JavaScript environment" should {
"successfully be able to load a configuration" in {
withValue(env[Option[String]]("APP_ENV")) {
case None
loadConfig(prop[Option[Int]]("http.port")) { port
case None =>
loadConfig(prop[Option[Int]]("http.port")) { port =>
("changeme", port getOrElse 4000, "local")
}

case Some(appEnv)
case Some(appEnv) =>
loadConfig(
env[String]("API_KEY"),
prop[Int]("http.port")
) { (apiKey, httpPort)
) { (apiKey, httpPort) =>
(apiKey, httpPort, appEnv)
}
} shouldBe a[Right[_, _]]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ trait JavaTimeConfigReaders {
import java.time._

implicit val dayOfWeekConfigReader: ConfigReader[DayOfWeek] =
fromOption("DayOfWeek")(value DayOfWeek.values.find(_.name equalsIgnoreCase value))
fromOption("DayOfWeek")(value => DayOfWeek.values.find(_.name equalsIgnoreCase value))

implicit val javaTimeDurationConfigReader: ConfigReader[Duration] =
catchNonFatal("Duration")(Duration.parse)
Expand All @@ -25,7 +25,7 @@ trait JavaTimeConfigReaders {
catchNonFatal("LocalTime")(LocalTime.parse)

implicit val monthConfigReader: ConfigReader[Month] =
fromOption("Month")(value Month.values.find(_.name equalsIgnoreCase value))
fromOption("Month")(value => Month.values.find(_.name equalsIgnoreCase value))

implicit val monthDayConfigReader: ConfigReader[MonthDay] =
catchNonFatal("MonthDay")(MonthDay.parse)
Expand Down Expand Up @@ -60,34 +60,34 @@ trait JavaTimeConfigReaders {
catchNonFatal("Chronology")(Chronology.of)

implicit val hijrahEraConfigReader: ConfigReader[HijrahEra] =
fromOption("HijrahEra")(value HijrahEra.values.find(_.name equalsIgnoreCase value))
fromOption("HijrahEra")(value => HijrahEra.values.find(_.name equalsIgnoreCase value))

implicit val isoEraConfigReader: ConfigReader[IsoEra] =
fromOption("IsoEra")(value IsoEra.values.find(_.name equalsIgnoreCase value))
fromOption("IsoEra")(value => IsoEra.values.find(_.name equalsIgnoreCase value))

implicit val japaneseEraConfigReader: ConfigReader[JapaneseEra] =
fromOption("JapaneseEra")(value JapaneseEra.values.find(_.toString equalsIgnoreCase value))
fromOption("JapaneseEra")(value => JapaneseEra.values.find(_.toString equalsIgnoreCase value))

implicit val minguoEraConfigReader: ConfigReader[MinguoEra] =
fromOption("MinguoEra")(value MinguoEra.values.find(_.name equalsIgnoreCase value))
fromOption("MinguoEra")(value => MinguoEra.values.find(_.name equalsIgnoreCase value))

implicit val thaiBuddhistEraConfigReader: ConfigReader[ThaiBuddhistEra] =
fromOption("ThaiBuddhistEra")(value ThaiBuddhistEra.values.find(_.name equalsIgnoreCase value))
fromOption("ThaiBuddhistEra")(value => ThaiBuddhistEra.values.find(_.name equalsIgnoreCase value))

import java.time.format._

implicit val dateTimeFormatterConfigReader: ConfigReader[DateTimeFormatter] =
catchNonFatal("DateTimeFormatter")(DateTimeFormatter.ofPattern)

implicit val formatStyleConfigReader: ConfigReader[FormatStyle] =
fromOption("FormatStyle")(value FormatStyle.values.find(_.name equalsIgnoreCase value))
fromOption("FormatStyle")(value => FormatStyle.values.find(_.name equalsIgnoreCase value))

implicit val resolverStyleConfigReader: ConfigReader[ResolverStyle] =
fromOption("ResolverStyle")(value ResolverStyle.values.find(_.name equalsIgnoreCase value))
fromOption("ResolverStyle")(value => ResolverStyle.values.find(_.name equalsIgnoreCase value))

implicit val signStyleConfigReader: ConfigReader[SignStyle] =
fromOption("SignStyle")(value SignStyle.values.find(_.name equalsIgnoreCase value))
fromOption("SignStyle")(value => SignStyle.values.find(_.name equalsIgnoreCase value))

implicit val textStyleConfigReader: ConfigReader[TextStyle] =
fromOption("TextStyle")(value TextStyle.values.find(_.name equalsIgnoreCase value))
fromOption("TextStyle")(value => TextStyle.values.find(_.name equalsIgnoreCase value))
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ final class JavaIoConfigReadersSpec extends PropertySpec {
"JavaIoConfigReaders" when {
"reading a File" should {
"successfully read File values" in {
forAll { string: String
forAll { string: String =>
readValue[File](string) shouldBe a[Right[_, _]]
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ final class JavaNetConfigReadersSpec extends PropertySpec {
"reading an InetAddress" should {
"successfully read InetAddress values" in {
val exampleAddresses = Gen.oneOf("localhost", "127.0.0.1")
forAll(exampleAddresses) { exampleAddress
forAll(exampleAddresses) { exampleAddress =>
readValue[InetAddress](exampleAddress) shouldBe a[Right[_, _]]
}
}
Expand All @@ -19,7 +19,7 @@ final class JavaNetConfigReadersSpec extends PropertySpec {
"reading an URI" should {
"successfully read URI values" in {
val exampleUris = Gen.oneOf("http://localhost", "ftp://localhost")
forAll(exampleUris) { exampleUri: String
forAll(exampleUris) { exampleUri: String =>
readValue[URI](exampleUri) shouldBe a[Right[_, _]]
}
}
Expand All @@ -28,7 +28,7 @@ final class JavaNetConfigReadersSpec extends PropertySpec {
"reading an URL" should {
"successfully read URL values" in {
val exampleUrls = Gen.oneOf("http://localhost", "ftp://localhost")
forAll(exampleUrls) { exampleUrl: String
forAll(exampleUrls) { exampleUrl: String =>
readValue[URL](exampleUrl) shouldBe a[Right[_, _]]
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ final class JavaNioCharsetConfigReadersJvmSpec extends PropertySpec {
val availableCharsets = Charset.availableCharsets().keySet().asScala.toSeq
val genAvailableCharset = Gen.oneOf(availableCharsets).flatMap(mixedCase)

forAll(genAvailableCharset) { charset
forAll(genAvailableCharset) { charset =>
readValue[Charset](charset) shouldBe a[Right[_, _]]
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ final class JavaNioFileConfigReadersSpec extends PropertySpec {
"JavaNioFileConfigReaders" when {
"reading a Path" should {
"successfully read Path values" in {
forAll { string: String
forAll { string: String =>
whenever(!fails(Paths.get(string))) {
readValue[Path](string) shouldBe Right(Paths.get(string))
}
Expand All @@ -18,7 +18,7 @@ final class JavaNioFileConfigReadersSpec extends PropertySpec {

"return a failure for invalid values" in {
val invalidPaths = List[String](null, "\u0000")
forAll(Gen.oneOf(invalidPaths)) { invalidPath
forAll(Gen.oneOf(invalidPaths)) { invalidPath =>
readValue[Path](invalidPath) shouldBe a[Left[_, _]]
}
}
Expand Down
Loading

0 comments on commit 00434cc

Please sign in to comment.