• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pureconfig / pureconfig / 16844894943

09 Aug 2025 03:28AM UTC coverage: 94.686% (-0.04%) from 94.726%
16844894943

Pull #1838

web-flow
Merge 12f0062cf into 38f73c635
Pull Request #1838: Rid of deprecated URL constructor

1 of 1 new or added line in 1 file covered. (100.0%)

95 existing lines in 26 files now uncovered.

2744 of 2898 relevant lines covered (94.69%)

2.43 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

86.67
/core/src/main/scala/pureconfig/syntax/package.scala
1
package pureconfig
2

3
import scala.reflect.ClassTag
4

5
import com.typesafe.config.{Config => TypesafeConfig, ConfigValue}
6

7
import pureconfig.error.ConfigReaderException
8

9
package object syntax {
10
  implicit class AnyWriterOps[A](val any: A) extends AnyVal {
1✔
11
    def toConfig(implicit writer: ConfigWriter[A]): ConfigValue = writer.to(any)
6✔
12
  }
13

14
  private def getResultOrThrow[Config](
1✔
15
      failuresOrResult: ConfigReader.Result[Config]
16
  )(implicit ct: ClassTag[Config]): Config = {
17
    failuresOrResult match {
18
      case Right(config) => config
2✔
19
      case Left(failures) => throw new ConfigReaderException[Config](failures)
4✔
20
    }
21
  }
22

23
  implicit class ConfigValueReaderOps(val conf: ConfigValue) extends AnyVal {
1✔
24
    def to[A](implicit reader: ConfigReader[A]): ConfigReader.Result[A] = reader.from(conf)
21✔
25
    def toOrThrow[A](implicit reader: ConfigReader[A], cl: ClassTag[A]): A =
1✔
26
      getResultOrThrow(reader.from(conf))(cl)
4✔
27
  }
28

UNCOV
29
  implicit class ConfigCursorReaderOps(val cur: ConfigCursor) extends AnyVal {
30
    def to[A](implicit reader: ConfigReader[A]): ConfigReader.Result[A] = reader.from(cur)
×
UNCOV
31
    def toOrThrow[A](implicit reader: ConfigReader[A], cl: ClassTag[A]): A =
32
      getResultOrThrow(reader.from(cur))(cl)
×
33
  }
34

35
  implicit class ConfigReaderOps(val conf: TypesafeConfig) extends AnyVal {
1✔
36
    def to[A](implicit reader: ConfigReader[A]): ConfigReader.Result[A] = conf.root().to[A]
4✔
37
    def toOrThrow[A](implicit reader: ConfigReader[A], cl: ClassTag[A]): A =
1✔
38
      getResultOrThrow(conf.root().to[A])(cl)
2✔
39
  }
40
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc