Skip to main content

format_yaml

Function format_yaml 

Source
pub fn format_yaml(input: &str) -> String
Expand description

Formats YAML / YML content matching VS Code esbenp.prettier-vscode (Prettier 3.7.4: tabWidth: 2, singleQuote: true, printWidth: 80, bracketSpacing: true, proseWrap: "preserve", LF).

§Arguments

  • &str - Raw YAML or YML document text.

§Returns

  • String - Formatted YAML text, or unchanged input if syntax errors occur.