strictyaml icon indicating copy to clipboard operation
strictyaml copied to clipboard

Remove dependency on ruamel.yaml

Open crdoconnor opened this issue 6 years ago • 2 comments

strictyaml is underpinned by ruamel.yaml - this is a dependency used to parse the YAML. It parses the YAML into an abstract syntax tree which is then run through the validator. ruamel.yaml is a YAML 1.2 parser and as such, contains an awful lot of cruft related to the complications involved in adhering to the spec. StrictYAML uses only a limited subset of its features.

Owing to the complications involved in parsing the YAML spec, the code complication has grown rather large and thus it would be more ideal if strictyaml handled parsing and roundtripping itself. There is also an unfortunate dependency on the internal workings of the library which has led to breakages in the past.

This refactoring should not change the behavior of the library itself, but simply remove the dependency on ruamel.yaml.

crdoconnor avatar Apr 20 '19 10:04 crdoconnor

ruamel.yaml v0.15 was a horrible time for everyone, but it is now v1.0, and should be more stable now.

Personally I think a lot of people are seeing ruamel.yaml as the roundtripping future, and strictyaml is better off re-using that roundtripping rather than competing with it. It is a very hard problem of course , and strictyaml might have a slightly simpler problem because of the strictness, but .. probably not simple enough to re-create that wheel.

jayvdb avatar Sep 11 '19 05:09 jayvdb

Another reason to use ruamel.yaml is it has, IMO, much better error messages than the alternatives, more often giving accurate & usable line/cols to find the source of errors.

jayvdb avatar Sep 11 '19 11:09 jayvdb