3 ms·
In my experience, relying on "prettifier" websites is directly a result of the lack of canonical, well-supported CLI tools for prettifying most programming and
by goatinaboat 5y ago
In my experience, relying on "prettifier" websites is directly a result of the lack of canonical, well-supported CLI tools for prettifying most programming and markup languages. It's such a weird glaring gap in dev tooling.
There's a CLI linter for pretty much every language I've used, but how would you prettify a valid YAML file? Any reformatting will change it semantically.
- sundbry 5y agoYou just parse and reserialize it. The trick is handling comments.
- dathinab 5y agoDon't underestimate YAML and not fully compliant YAML parsers(1) and sterilizer's with everything but nice results. (1): Which can be necessary to prevent accidental problems like NO defaulting to false not "NO" and similar. I personally strongly recommend against anything where string quotes are optional for human written/edited serialization formats (and comments are a must have).