Validate YAML before proceeding
What does this Merge Request do?
This MR will validate YAML before performing any further actions. It will catch invalid YAML as well as invalid settings, e.g.:
Invalid YAML (completely invalid)
gdk.yml
---
broken
$ gdk doctor
(❌) Error: Your gdk.yml is invalid.
undefined method `fetch' for "broken":String
Invalid YAML (partially invalid)
gdk.yml
---
gdk:
experimental:
quiet: true
broken
$ gdk doctor
(❌) Error: Your gdk.yml is invalid.
(/Users/ash/src/gdk/scratch1/gdk.yml): could not find expected ':' while scanning a simple key at line 6 column 1
Invalid setting
gdk.yml
---
gdk:
experimental:
quiet: tre
$ gdk doctor
(❌) Error: Your gdk.yml is invalid.
Value 'tre' for gdk.experimental.quiet is not a valid bool
Merge Request checklist
-
Tests added for new functionality. If not, please raise Issue to follow-up. -
This change is backward compatible. If not, please include steps to communicate to our users. -
Documentation added/updated, if needed. -
gdk doctor
test added, if needed.
Closes #890 (closed)
Edited by Ash McKenzie