We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I have the following yaml file:
--- - key: ['value?']
which loads correctly in python with pyyaml's yaml.safe_load.
yaml.safe_load
ruyaml changes the file to
ruyaml
--- - key: [value?]
which cannot be loaded by pyyaml's yaml.safe_load, error being "expected ',' or ']', but got '?'"
error being "expected ',' or ']', but got '?'"
yq breaks similarly with error parse error: Invalid numeric literal at line 2, column 0
yq
parse error: Invalid numeric literal at line 2, column 0
It would be nice if ruyaml did not remove quotes on strings with question marks (and whatever other set of characters can cause this issue).
I've assembled a small example to reproduce the issue:
from io import StringIO import ruyaml original_source_code = "---\n - key: ['value?']" yaml = ruyaml.main.YAML() yaml.indent(mapping=2, sequence=4, offset=2) yaml.allow_duplicate_keys = True yaml.explicit_start = True yaml.width = 80 source_dicts = yaml.load_all(original_source_code) string_stream = StringIO() for source_dict in source_dicts: yaml.dump(source_dict, string_stream) source_code = string_stream.getvalue() string_stream.close() assert original_source_code == source_code >>> AssertionError >>> source_code '---\n - key: [value?]\n'
Thank you
Related issue: lyz-code/yamlfix#188
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I have the following yaml file:
which loads correctly in python with pyyaml's
yaml.safe_load
.ruyaml
changes the file towhich cannot be loaded by pyyaml's
yaml.safe_load
,error being "expected ',' or ']', but got '?'"
yq
breaks similarly with errorparse error: Invalid numeric literal at line 2, column 0
It would be nice if ruyaml did not remove quotes on strings with question marks (and whatever other set of characters can cause this issue).
I've assembled a small example to reproduce the issue:
Thank you
Related issue: lyz-code/yamlfix#188
The text was updated successfully, but these errors were encountered: