-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possible bug or oversight with list values and indentation #41
Comments
Looks like a dash counts as indentation. I'll try my hand at patching this in yafyaml. |
Yup - needs a unit test as well. The parsing bit is ugly code conversion from Python, so probably far from obvious just what needs to change. We may have to live with this and/or write a converter script to add spaces before leading hyphens in your scenario. |
Yeah, I tried to fix it for a little while but just ended up breaking other things and gave up. For now I can create a script to add spaces. I also tried with futility to see if the python yaml emitter has any sort of formatting options to do this. |
By comparing with the python source for managing indentation, I did spot that the problem may be with this function: Lines 568 to 572 in 6b9a50e
You could try playing with the |
@bena-nasa Did you ever attempt the change suggested above? I'm about to do some other work in this layer, so would be a good time to get the fix in (if we know what the fix is) |
I've been working on a script to generate a yaml input file for a project from the old version in a different format. I ended up creating a python script and creating a dictionary which I dump to a file with the Python yaml modules "dump" function to take a dictionary and emits it as a yaml text.
In my first attempt I generated a Yaml file that looked like this:
When this was being ingested by Yafyaml however it crashed and spit out this error:
I stared at the file for quite a while and could not see what was wrong. Finally after much starting and comparing to a file a I knew that worked the only thing I would see is that the yaml file above has keys who have values that are lists that are not indented (the Enable: key for example, same with groups under collections).
So I indented the lists like so
and Yafyaml was happy. At least as far as python's yaml implementation was concerned it must think that is valid yaml as that is what it produced via the "dump" function of the yaml library. So I'm guessing (still looking) that the first is valid Yaml that is not support by Yafyaml?
The text was updated successfully, but these errors were encountered: