• 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

90.91
/modules/yaml/src/main/scala/pureconfig/module/yaml/package.scala
1
package pureconfig.module
2

3
import java.nio.file.Path
4

5
import scala.reflect.ClassTag
6

7
import pureconfig._
8
import pureconfig.error._
9

10
package object yaml {
11

12
  /** Loads a configuration of type `Config` from the given YAML file.
13
    *
14
    * @param path
15
    *   the path of the YAML file to read
16
    * @return
17
    *   A `Success` with the configuration if it is possible to create an instance of type `Config` from the YAML file,
18
    *   else a `Failure` with details on why it isn't possible
19
    */
20
  @deprecated("Use `YamlConfigSource.file(path).load[Config]` instead", "0.12.1")
21
  def loadYaml[Config](path: Path)(implicit reader: ConfigReader[Config]): ConfigReader.Result[Config] = {
1✔
22
    YamlConfigSource.file(path).load[Config]
2✔
23
  }
24

25
  /** Loads a configuration of type `Config` from the given YAML file.
26
    *
27
    * @param path
28
    *   the path of the YAML file to read
29
    * @param namespace
30
    *   the base namespace from which the configuration should be load
31
    * @return
32
    *   A `Success` with the configuration if it is possible to create an instance of type `Config` from the YAML file,
33
    *   else a `Failure` with details on why it isn't possible
34
    */
35
  @deprecated("Use `YamlConfigSource.file(path).at(namespace).load[Config]` instead", "0.12.1")
36
  def loadYaml[Config](path: Path, namespace: String)(implicit
1✔
37
      reader: ConfigReader[Config]
38
  ): ConfigReader.Result[Config] = {
39
    YamlConfigSource.file(path).at(namespace).load[Config]
2✔
40
  }
41

42
  /** Loads a configuration of type `Config` from the given string.
43
    *
44
    * @param content
45
    *   the string containing the YAML document
46
    * @return
47
    *   A `Success` with the configuration if it is possible to create an instance of type `Config` from `content`, else
48
    *   a `Failure` with details on why it isn't possible
49
    */
50
  @deprecated("Use `YamlConfigSource.string(content).load[Config]` instead", "0.12.1")
51
  def loadYaml[Config](content: String)(implicit reader: ConfigReader[Config]): ConfigReader.Result[Config] = {
1✔
52
    YamlConfigSource.string(content).load[Config]
2✔
53
  }
54

55
  @deprecated("Use `YamlConfigSource.string(content).at(namespace).load[Config]` instead", "0.12.1")
56
  def loadYaml[Config](content: String, namespace: String)(implicit
1✔
57
      reader: ConfigReader[Config]
58
  ): ConfigReader.Result[Config] = {
59
    YamlConfigSource.string(content).at(namespace).load[Config]
2✔
60
  }
61

62
  /** Loads a configuration of type `Config` from the given YAML file.
63
    *
64
    * @param path
65
    *   the path of the YAML file to read
66
    * @return
67
    *   the configuration
68
    */
69
  @throws[ConfigReaderException[_]]
70
  @deprecated("Use `YamlConfigSource.file(path).loadOrThrow[Config]` instead", "0.12.1")
71
  def loadYamlOrThrow[Config: ClassTag](path: Path)(implicit reader: ConfigReader[Config]): Config = {
1✔
72
    YamlConfigSource.file(path).loadOrThrow[Config]
2✔
73
  }
74

75
  /** Loads a configuration of type `Config` from the given YAML file.
76
    *
77
    * @param path
78
    *   the path of the YAML file to read
79
    * @param namespace
80
    *   the base namespace from which the configuration should be load
81
    * @return
82
    *   the configuration
83
    */
84
  @throws[ConfigReaderException[_]]
85
  @deprecated("Use `YamlConfigSource.file(path).at(namespace).loadOrThrow[Config]` instead", "0.12.1")
UNCOV
86
  def loadYamlOrThrow[Config: ClassTag](path: Path, namespace: String)(implicit
87
      reader: ConfigReader[Config]
88
  ): Config = {
89
    YamlConfigSource.file(path).at(namespace).loadOrThrow[Config]
×
90
  }
91

92
  /** Loads a configuration of type `Config` from the given string.
93
    *
94
    * @param content
95
    *   the string containing the YAML document
96
    * @return
97
    *   the configuration
98
    */
99
  @throws[ConfigReaderException[_]]
100
  @deprecated("Use `YamlConfigSource.string(content).loadOrThrow[Config]` instead", "0.12.1")
101
  def loadYamlOrThrow[Config: ClassTag](content: String)(implicit reader: ConfigReader[Config]): Config = {
1✔
102
    YamlConfigSource.string(content).loadOrThrow[Config]
2✔
103
  }
104

105
  /** Loads a configuration of type `Config` from the given string.
106
    *
107
    * @param content
108
    *   the string containing the YAML document
109
    * @param namespace
110
    *   the base namespace from which the configuration should be load
111
    * @return
112
    *   the configuration
113
    */
114
  @throws[ConfigReaderException[_]]
115
  @deprecated("Use `YamlConfigSource.string(content).at(namespace).loadOrThrow[Config]` instead", "0.12.1")
UNCOV
116
  def loadYamlOrThrow[Config: ClassTag](content: String, namespace: String)(implicit
117
      reader: ConfigReader[Config]
118
  ): Config = {
119
    YamlConfigSource.string(content).at(namespace).loadOrThrow[Config]
×
120
  }
121

122
  /** Loads a configuration of type `Config` from the given multi-document YAML file. `Config` must have a
123
    * `ConfigReader` supporting reading from config lists.
124
    *
125
    * @param path
126
    *   the path of the YAML file to read
127
    * @return
128
    *   A `Success` with the configuration if it is possible to create an instance of type `Config` from the
129
    *   multi-document YAML file, else a `Failure` with details on why it isn't possible
130
    */
131
  @deprecated("Use `YamlConfigSource.file(path).multiDoc.load[Config]` instead", "0.12.1")
132
  def loadYamls[Config](path: Path)(implicit reader: ConfigReader[Config]): ConfigReader.Result[Config] = {
1✔
133
    YamlConfigSource.file(path).multiDoc.load[Config]
2✔
134
  }
135

136
  /** Loads a configuration of type `Config` from the given multi-document string. `Config` must have a `ConfigReader`
137
    * supporting reading from config lists.
138
    *
139
    * @param content
140
    *   the string containing the YAML documents
141
    * @return
142
    *   A `Success` with the configuration if it is possible to create an instance of type `Config` from the
143
    *   multi-document string, else a `Failure` with details on why it isn't possible
144
    */
145
  @deprecated("Use `YamlConfigSource.string(content).multiDoc.load[Config]` instead", "0.12.1")
146
  def loadYamls[Config](content: String)(implicit reader: ConfigReader[Config]): ConfigReader.Result[Config] = {
1✔
147
    YamlConfigSource.string(content).multiDoc.load[Config]
2✔
148
  }
149

150
  /** Loads a configuration of type `Config` from the given multi-document YAML file. `Config` must have a
151
    * `ConfigReader` supporting reading from config lists.
152
    *
153
    * @param path
154
    *   the path of the YAML file to read
155
    * @return
156
    *   the configuration
157
    */
158
  @throws[ConfigReaderException[_]]
159
  @deprecated("Use `YamlConfigSource.file(path).multiDoc.loadOrThrow[Config]` instead", "0.12.1")
160
  def loadYamlsOrThrow[Config: ClassTag](path: Path)(implicit reader: ConfigReader[Config]): Config = {
1✔
161
    YamlConfigSource.file(path).multiDoc.loadOrThrow[Config]
2✔
162
  }
163

164
  /** Loads a configuration of type `Config` from the given multi-document string. `Config` must have a `ConfigReader`
165
    * supporting reading from config lists.
166
    *
167
    * @param content
168
    *   the string containing the YAML documents
169
    * @return
170
    *   the configuration
171
    */
172
  @throws[ConfigReaderException[_]]
173
  @deprecated("Use `YamlConfigSource.string(content).multiDoc.loadOrThrow[Config]` instead", "0.12.1")
174
  def loadYamlsOrThrow[Config: ClassTag](content: String)(implicit reader: ConfigReader[Config]): Config = {
1✔
175
    YamlConfigSource.string(content).multiDoc.loadOrThrow[Config]
2✔
176
  }
177
}
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