Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ Eventually we can facilitate validation after a configuration is built.
| YAML | Short and simple files that are not edited often.<br/> Good support for strings with newlines. <br/> Since JSON is valid YAML, JSON with comments can be used. | Getting the indentation wrong can mean that properties are ignored.<br/> If you try to use JSON, your editor may automatically convert the JSON to simpler YAML depending on your settings or your project might have certain style checks enabled for YAML files. |
| JSON5 | Good mix of features from JSON and YAML. | Your IDE may require an extension to help with validation. |

Other types are supported as the [config](https://crates.io/crates/config) Rust crate is used to back this project, but those other types are not as well-known and not as nice for working with deep objects so they are not recommended.
Other types are supported as the [config](https://crates.io/crates/config) Rust crate is used to load files (but not merge them anymore), but those other types are not as well known and not as nice for working with deep objects so they are not recommended.
In most cases, JSON should be preferred to help with some basic static structural validation at load time.
Standard JSON validation will easily catch issues such as a bad merge conflict resolution, whereas it is easy to have valid YAML, but would not work as expected at runtime because of incorrect indentation.

Expand Down
7 changes: 6 additions & 1 deletion rust/optify/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ This is just meant to be minimal to get started and help build Python and Ruby l

## How It Works

The [`config`][config] crate (library) is used to help combine configuration files.
The [`config`][config] crate (library) is used to help load configuration files.
This allows us to load many different types of files, including JSON, JSON5, YAML, and more.
We no longer use the `config` crate to combine configuration files because it was slower to merge them and deserialize the result than our custom merging logic since we know that we want to use `serde_json::Value`s.

We merge configurations starting with the first one given and thus the final feature overrides the previous ones.
We may try to optimize further in the future, but this is fine now when there are just a few features or imports and when keys are mostly unique.

Optionally, when working locally, there is support to watch for changes to the configuration files and folders using the [`notify-debouncer-full`][notify-debouncer-full] crate (library).

Expand Down
Loading