Open rofinn opened 6 years ago
http://yaml.org/spec/1.2/spec.html#id2777534
The YAML 1.2 spec says that any number of spaces can be used to represent an indentation level.
This has come up a few times in clap
with an open issue being kbknapp/clap-rs#965
clap
was indeed how Rory discovered this
I don't think this is true, as I commented on kbknapp/clap-rs#965 already. I also have some tests that should demonstrate this. Or do I not understand correctly?
@hoodie I agree the specific test referenced in clap#965 doesn't quite line up with this issue, however just today I ran into an issue where the only change made was indents from 4 to 2 and it works with 4 but fails with 2.
Once I get to a computer I can post the actual test for reference.
Just ran into this today via Clap. Having a background with Rails and Jekyll, I wrote my Clap yaml with two spaces for indentation and then was beat over the head with weird issues where the yaml would fail to parse. Took some digging and found out that indentation by two spaces is what killed me. Given that every other yaml parser I've used hasn't cared about the number of spaces present, but rather the number of spaces relative to the parent, I'd love to see this functionality added!
Especially of note here, most editors default to two spaces for indentation in yaml, since that's become the de-facto standard for yaml writers/consumers, which could really exacerbate the issue in Rust projects.
It appears that yaml-rust only supports 4 spaces for indentation.