yamltidy is a formatter/tidier for YAML files.
Currently it can:
Plans for the future:
- Adjust indentation
- Trim trailing spaces
It can be configured via a YAML config file, similar to yamllint.
- Align mapping values
- Format anchors and tags to be on the same line as the parent node
- Reformat flow collections
What it can't do:
For such things it's recommended to use a linter like
- 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: