-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
When parsing a yaml file with an anchor, yaml2jsonnet generates a traceback:
$ cat anchor-example.yaml
foo: &foo-ref
key-1: "val-1"
key-2: "val-2"
var: *foo-ref
$ yaml2jsonnet anchor-example.yaml
Traceback (most recent call last):
File "/home/user/.local/bin/yaml2jsonnet", line 8, in <module>
sys.exit(main())
File "/home/user/.local/lib/python3.9/site-packages/yaml2jsonnet/cli.py", line 58, in main
run(args)
File "/home/user/.local/lib/python3.9/site-packages/yaml2jsonnet/cli.py", line 47, in run
convert_yaml(yaml_data, args.out, args.document_comments)
File "/home/user/.local/lib/python3.9/site-packages/yaml2jsonnet/yaml2jsonnet.py", line 14, in convert_yaml
JsonnetRenderer(events, output, array, inject_comments).render()
File "/home/user/.local/lib/python3.9/site-packages/yaml2jsonnet/jsonnet_renderer.py", line 210, in render
self.state.send(event)
File "/home/user/.local/lib/python3.9/site-packages/yaml2jsonnet/jsonnet_renderer.py", line 383, in _mapping_value
raise UnhandledEventError(self, event)
yaml2jsonnet.jsonnet_renderer.UnhandledEventError: Event was not handled by the current state: Last event was AliasEvent(anchor='foo-ref'), the state was _mapping_value, the queue was [(StreamStartEvent,_start), (DocumentStartEvent,_stream), (MappingStartEvent,_document)]Instead it'd be nice to show an error like "Yaml anchors are not supported. Please remove them and try again."
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels