Coder Social home page Coder Social logo

Support indentation w/ 2 spaces about yaml-rust HOT 6 OPEN

chyh1990 avatar chyh1990 commented on September 26, 2024 9
Support indentation w/ 2 spaces

from yaml-rust.

Comments (6)

iamed2 avatar iamed2 commented on September 26, 2024 2

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.

from yaml-rust.

kbknapp avatar kbknapp commented on September 26, 2024 2

@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.

from yaml-rust.

berwyn avatar berwyn commented on September 26, 2024 2

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.

from yaml-rust.

kbknapp avatar kbknapp commented on September 26, 2024

This has come up a few times in clap with an open issue being clap-rs/clap#965

from yaml-rust.

iamed2 avatar iamed2 commented on September 26, 2024

clap was indeed how Rory discovered this

from yaml-rust.

hoodie avatar hoodie commented on September 26, 2024

I don't think this is true, as I commented on clap-rs/clap#965 already. I also have some tests that should demonstrate this. Or do I not understand correctly?

from yaml-rust.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.