Open ProjitB opened 2 years ago
I would add also the thing of using the better output message if checking the dozens of files in one directory, for example by this command:argo lint ./
(lint all in current dir), but the output is like:
ERRO[current_date_time_stamp] yaml file at index 0 is not valid: error converting YAML to JSON: yaml: line 28: could not find expected ':'
✔ no linting errors found!
so basically no error but the error shown here is not clear which file is affected from:
ls -la | wc -l
25
24 files in fact (including line total
)
which one in fact is affected? I I use loglevel
flag, it still doesn't uncover it:
argo lint ./ --loglevel error
ERRO[current_date_time_stamp] yaml file at index 0 is not valid: error converting YAML to JSON: yaml: line 28: could not find expected ':'
✔ no linting errors found!
could it be like:
ERRO[current_date_time_stamp] [<file_name.yaml>] yaml file at index 0 is not valid: error converting YAML to JSON: yaml: line 28: could not find expected ':'
or
ERRO[current_date_time_stamp] yaml file <file_name.yaml> at index 0 is not valid: error converting YAML to JSON: yaml: line 28: could not find expected ':'
Thank you!
Summary
What change needs making?
Enhancing yaml parsing debug messages to give more descriptive linting / debug information.
Use Cases
The Argo linter is heavily used for validating workflow configurations before actually running them (for correctness purposes). As yaml keys aren't order dependent, common yaml issues like duplicate keys should be caught with better error messages.
Ex.
Taking a quick glance at a template, sometimes we add in a key again (in this case the
command
key). However, on doing so, the linter fails with this:Verbose:
The above messaging is confusing and very hard to debug. Ideally these kinds of relatively common errors should be caught?