yamltidy
is a formatter/tidier for YAML files.
Currently it can:
- Adjust indentation
- Trim trailing spaces
- Add or remove header
---
and footer ...
- Enforce quoting style (currently only for single line scalars in block mode)
Plans for the future:
- Align mapping values
- Format anchors and tags to be on the same line as the parent node
- Reformat flow collections
It can be configured via a YAML config file, similar to yamllint.
What it can't do:
- Fix invalid YAML
- Align comments if it's not clear where they belong to.
Examples for a large number of input files can be found here:
Usage:
yamltidy
Links: