optnc/yamlfixer

By optnc

Updated over 2 years ago

Yamlfixer automates the fixing of problems reported by yamllint by parsing its output.

Image

3.9K

yamlfixer

yamlfixer automates the fixing of problems reported by yamllint by parsing its output.

Usage

This software automatically fixes some errors and warnings reported by yamllint.

docker pull optnc/yamlfixer
docker run -i -t --rm optnc/yamlfixer /bin/sh
$ yamlfixer [--debug] [--verbose] [--backup] *.yml - thisfile.yaml

or:

$ yamlfixer [--help] [--version]

This will launch yamllint on each specified file name (- is stdin), then parse its output and try to fix the reported problems.

If input is read from stdin, the corrected output will be sent to stdout. Other files will be overwritten if needed. Original files, stdin excepted, can be preserved as .orig if the --backup command line option is used.

Diagnostic information is sent to stderr in verbose or debug modes.

This command exits with 0 if all input files either are skipped or successfully pass yamllint strict mode, else -1.

IMPORTANT: Not all problems are fixable by yamlfixer. Due to the way yamllint works, it doesn't currenlty report all faulty lines, yamlfixer might even introduce indentation problems under some circumstances. Use at your own risk, you have been warned...

Docker Pull Command

docker pull optnc/yamlfixer