<commit_before># YAML module for PureConfig

Adds support to PureConfig for reading YAML files as configurations. The module uses [SnakeYAML](https://bitbucket.org/asomov/snakeyaml) to parse YAML documents and reuses the existing PureConfig structure
of `ConfigReader`s and hints to read configurations to domain objects without boilerplate.

## Add pureconfig-yaml to your project

In addition to the [PureConfig core](https://github.com/pureconfig/pureconfig), you'll need:

```scala
libraryDependencies += "com.github.pureconfig" %% "pureconfig-yaml" % "0.11.1"
```

## Example

Given a type to hold our configuration:

```scala
import pureconfig.generic.auto._
import pureconfig.module.yaml._

case class Person(name: String, age: Int, children: List[Person])
```

And a YAML document with the appropriate format:

```scala
import java.nio.file.Files

val yamlFile = Files.createTempFile("conf-", ".yaml")
Files.write(yamlFile, """
  | name: John
  | age: 42
  | children:
  |   - name: Sarah
  |     age: 7
  |     children: []
  |   - name: Andy
  |     age: 10
  |     children: []
  | """.stripMargin.getBytes)
```

We can load the configuration to a `MyConf` instance using `loadYaml`:

```scala
loadYaml[Person](yamlFile)
// res1: pureconfig.ConfigReader.Result[Person] = Right(Person(John,42,List(Person(Sarah,7,List()), Person(Andy,10,List()))))
```

We can also load a particular namespace inside the YAML file:

```scala
loadYaml[List[Person]](yamlFile, "children")
```<commit_msg>Add result type to README file<commit_after># YAML module for PureConfig

Adds support to PureConfig for reading YAML files as configurations. The module uses [SnakeYAML](https://bitbucket.org/asomov/snakeyaml) to parse YAML documents and reuses the existing PureConfig structure
of `ConfigReader`s and hints to read configurations to domain objects without boilerplate.

## Add pureconfig-yaml to your project

In addition to the [PureConfig core](https://github.com/pureconfig/pureconfig), you'll need:

```scala
libraryDependencies += "com.github.pureconfig" %% "pureconfig-yaml" % "0.11.1"
```

## Example

Given a type to hold our configuration:

```scala
import pureconfig.generic.auto._
import pureconfig.module.yaml._

case class Person(name: String, age: Int, children: List[Person])
```

And a YAML document with the appropriate format:

```scala
import java.nio.file.Files

val yamlFile = Files.createTempFile("conf-", ".yaml")
Files.write(yamlFile, """
  | name: John
  | age: 42
  | children:
  |   - name: Sarah
  |     age: 7
  |     children: []
  |   - name: Andy
  |     age: 10
  |     children: []
  | """.stripMargin.getBytes)
```

We can load the configuration to a `MyConf` instance using `loadYaml`:

```scala
loadYaml[Person](yamlFile)
// res1: pureconfig.ConfigReader.Result[Person] = Right(Person(John,42,List(Person(Sarah,7,List()), Person(Andy,10,List()))))
```

We can also load a particular namespace inside the YAML file:

```scala
loadYaml[List[Person]](yamlFile, "children")
// res2: pureconfig.ConfigReader.Result[List[Person]] = Right(List(Person(Sarah,7,List()), Person(Andy,10,List())))
```
{'fraction_non_alphanumeric': 0.13544668587896252, 'fraction_numerical': 0.010886967659301952, 'mean_word_length': 4.742647058823529, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, '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': '6163623', 'n_tokens_mistral': 1064, 'n_tokens_neox': 968, 'n_words': 295}