This is exactly why TOML [0] is gaining traction as a simple configuration file format. Rust's cargo has been TOML from day one (`Cargo.toml`) and Python is moving this way with (`pyproject.toml`).
For more general data structures, remember that JSON is a true subset of YAML [1]: Switch to a YAML parser and you can start optionally adding comments to your files while still being compatible with legacy input.
Yaml is generally derided as too complex and transforming data in unintended ways.
I see a lot of Rust programmers preferring RON over TOML because it is much less complex and doesn't have multiple ways to express the same thing https://crates.io/crates/ron
I hate YAML. XML and JSON have syntaxes that are very easy to learn. You basically see one example and know 99% of what you need. YAML has multiple ways of doing the same thing (eg. two array syntaxes) and is generally too "clean" looking to the point of being unreadable.
For more general data structures, remember that JSON is a true subset of YAML [1]: Switch to a YAML parser and you can start optionally adding comments to your files while still being compatible with legacy input.
[0] https://toml.io/en/ [1] https://yaml.org/