Skip to content

Semi-tolerant and configurable YAML formatter with dprint integration.

License

Notifications You must be signed in to change notification settings

g-plane/pretty_yaml

Repository files navigation

Pretty YAML

Pretty YAML is a semi-tolerant and configurable YAML formatter.

GitHub Downloads

Getting Started

dprint

We've provided dprint integration.

Run the command below to add plugin:

dprint config add g-plane/pretty_yaml

After adding the dprint plugin, update your dprint.json and add configuration:

{
  // ...
  "yaml": { // <-- the key name here is "yaml", not "pretty_yaml"
    // Pretty YAML config comes here
  },
  "plugins": [
    "https://plugins.dprint.dev/g-plane/pretty_yaml-v0.5.0.wasm"
  ]
}

You can also read dprint CLI documentation for using dprint to format files.

Configuration

Please refer to Configuration.

Using in Rust

Formatter

The formatter can be used in Rust. Please read the documentation.

Parser

If you want to use the underlying parser, please refer to the documentation.

Credit

Tests come from Prettier.

License

MIT License

Copyright (c) 2024-present Pig Fang