2 ms·
I can't remember the parts that pained me most. Some were in somewhat odd sounding "lists of single items" versus "list of single dict items" and such. In par
by taeric 9y ago
I can't remember the parts that pained me most. Some were in somewhat odd sounding "lists of single items" versus "list of single dict items" and such. In particular, the vast difference between:
baz:
bat:
- foo: bar
and
baz:
bat:
- foo: bar
is not at all obvious at a glance to me. If I convinced everyone to move to 4 or 8 character indents, it would stick out a little more, but I don't see myself winning that fight.
Worst of all, this mistake happened when I was moving some template from one place to another in a different file. Should be easy. Copy, paste, fix whitespace. The problem is that "fix whitespace" has to know about the copy/paste. You can't just reformat after the fact. Yes, tooling could "paste with indentation for current cursor" but you literally cannot "paste, then fix whitespace." It is like the worst of outlooks "paste with formatting".
- crdoconnor 9y agoI actually wrote a YAML parser that closed this loophole by raising an exception on YAML files that have inconsistent indents. Somebody reported exactly that as an issue on my issue tracker: https://github.com/crdoconnor/strictyaml/issues/23 https://github.com/crdoconnor/strictyaml/issues/23 I'm aware that there are a bunch of annoyances like that, but I'm still convinced the core is good and making a new standard which is stricter solves most of these issues. FWIW, I haven't run into this problem personally but it's pretty obvious that it is a problem.