Chris Neale bio photo

Chris Neale

Twitter LinkedIn Github

vscode logo

VSCode checks so much out of the box…just not YAML

Anyone who has ever had to write YAML code, for pipelines/devops/terraform etc. then you will know how fickle it can be with spaces, tabs and indentation.
We recently had an issue where someone had edited directly in github (something we ‘discourage’ heavily unless there is some real exception justified) and in doing so had messed up the indentation. It wasn’t until someone tried to run the pipeline that the issue was discovered as it gets checked against the YML schema prior to running.

I was sure that VSCode would have warned them, had they used it instead of editing on the web. However I was a little surprised to see that YML isn’t part of the built-in intellisense/validation checks.

The top result in extensions for YAML is the Redhat extension. After installing that, BOOM instant YAML errors shown.

yaml validation error

It’s free and quick to install.
The URL is Redhat YAML validation extension

yaml validation extension