Skip to content

Commit

Permalink
chore: Update PureConfig and some other dependencies (#56)
Browse files Browse the repository at this point in the history
* chore: Update PureConfig and some other dependencies

* build: Use WARN log level for tests to limit output

Co-authored-by: Jakub Janeček <[email protected]>
  • Loading branch information
jakubjanecek and Jakub Janeček authored Oct 7, 2020
1 parent e97d261 commit b12d5f6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ allprojects {
circeVersion = "0.13.0"
cactusVersion = "0.17.0"
catsVersion = "2.1.1"
catsEffectVersion = "2.1.4"
fs2Version = "2.4.2"
catsEffectVersion = "2.2.0"
fs2Version = "2.4.4"
protobufVersion = "3.12.4"
scalapbVersion = "0.10.8"
scalapbJson4sVersion = "0.10.1"
Expand Down Expand Up @@ -122,7 +122,7 @@ subprojects {
dependencies {
scalaCompilerPlugin "org.typelevel:kind-projector_$scalaVersionFull:0.11.0"

compile "org.scala-lang.modules:scala-collection-compat_$scalaVersion:2.1.6"
compile "org.scala-lang.modules:scala-collection-compat_$scalaVersion:2.2.0"

testCompile "io.monix:monix_$scalaVersion:$monixVersion"

Expand Down
2 changes: 1 addition & 1 deletion core/src/test/resources/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</encoder>
</appender>

<root level="INFO">
<root level="WARN">
<appender-ref ref="STDOUT"/>
</root>

Expand Down
2 changes: 1 addition & 1 deletion pureconfig/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ dependencies {
compile project(":core")

compile 'com.typesafe:config:1.4.0'
compile "com.github.pureconfig:pureconfig_${scalaVersion}:0.13.0"
compile "com.github.pureconfig:pureconfig_${scalaVersion}:0.14.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import com.typesafe.config.Config
import org.slf4j.event.Level
import pureconfig.error._

import scala.jdk.CollectionConverters._
import scala.collection.compat._
import scala.jdk.CollectionConverters._
import scala.util.{Failure, Success}

// scalastyle:off
Expand Down Expand Up @@ -113,14 +113,14 @@ class PureconfigImplicits(implicit namingConvention: NamingConvention = CamelCas
}

implicit val mapStringAnyReader: ConfigReader[Map[String, Any]] = ConfigReader.fromCursor { cur =>
cur.asObjectCursor.map(_.value.asScala.view.mapValues(_.unwrapped()).toMap)
cur.asObjectCursor.map(_.objValue.asScala.view.mapValues(_.unwrapped()).toMap)
}

implicit val declareArgumentsConfigReader: ConfigReader[DeclareArgumentsConfig] = mapStringAnyReader.map(DeclareArgumentsConfig)
implicit val bindArgumentsConfigReader: ConfigReader[BindArgumentsConfig] = mapStringAnyReader.map(BindArgumentsConfig)

private def withType[A](cur: ConfigCursor)(f: (Config, String) => Result[A]): Result[A] = {
cur.asObjectCursor.map(_.value.toConfig).flatMap { config =>
cur.asObjectCursor.map(_.objValue.toConfig).flatMap { config =>
val `type` = config.getString("type")
val strippedConfig = config.withoutPath("type")

Expand All @@ -146,7 +146,7 @@ class PureconfigImplicits(implicit namingConvention: NamingConvention = CamelCas
private val DerivedReader: ConfigReader[RabbitMQConnectionConfig] = deriveReader[RabbitMQConnectionConfig]

override def from(cur: ConfigCursor): Result[RabbitMQConnectionConfig] = {
cur.asObjectCursor.map(_.value.toConfig).flatMap { config =>
cur.asObjectCursor.map(_.objValue.toConfig).flatMap { config =>
val configKeys = config.entrySet.asScala.map(_.getKey.split("\\.").head).toSet
val classKeys = fieldsOf[RabbitMQConnectionConfig].map(_.name.toString).map(CamelCase.toTokens).map(namingConvention.fromTokens)

Expand Down

0 comments on commit b12d5f6

Please sign in to comment.