YAML::Tidy(3)

πŸ“¦ version 0.10.0, in opensuse-leap 16.0

πŸŽ€ YAML::Tidy(3) β€” bestie edition πŸŽ€

okay so this is the YAML::Tidy(3) page β€” yes, a User Contributed Perl Documentation moment β€” and we’re gonna get you comfy with it πŸ’…βœ¨


✨ NAME ✨

YAML::Tidy β€” tidy YAML files. That’s literally the name, and it ate 🫢


🌸 SYNOPSIS 🌸

okay bestie, here’s the little before/after moment, exactly as written:

% cat in.yaml
a: # a comment
    b:
     c: d
% yamltidy in.yaml
a: # a comment
  b:
    c: d

πŸ’« DESCRIPTION πŸ’«

yamltidy is a linter β€” or rather a formatter β€” for YAML files. No cap.

It can adjust formatting without removing comments or blank lines. That’s the whole vibe: make it pretty, keep the receipts πŸ’–

For examples see <https://perlpunk.github.io/yamltidy> ✨

The code can be found at <https://github.com/perlpunk/yamltidy>. πŸ‘‘


πŸ¦‹ FEATURES πŸ¦‹

  • Trim trailing spaces
  • Adjust indentation
  • Add or remove headers and footers
  • Remove unnecessary quotes (currently according to the YAML 1.2 Core Schema)
  • Serialize reused aliases

🌱 Plans 🌱

  • Add option for batch processing multiple files, e.g. by extension
  • Use exit code to signal if yamltidy did any changes
  • Quoting: Allow to add patterns for strings that should be quoted
  • For more, see <https://github.com/perlpunk/yamltidy/issues>. Suggestions welcome! 🫢

πŸ’… METHODS πŸ’…

πŸ’« new

my $yt = YAML::Tidy->new;

πŸ’« tidy

my $outyaml = $yt->tidy($inyaml);

πŸ’« highlight

my $ansicolored = $yt->highlight($yaml, 'ansi');
my $html = $yt->highlight($yaml, 'html');

πŸ’« cfg

my $cfg = $yt->cfg;

Return YAML::Tidy::Config β€” that’s the return value, bestie 🌈


🫢 AUTHOR 🫢

Tina MΓΌller <tinita@cpan.org> β€” iconic behavior, honestly πŸ‘‘


πŸ”₯ SEE ALSO πŸ”₯


Copyright 2024 by Tina MΓΌller

This library is free software and may be distributed under the same terms as perl itself.


πŸ’– That’s the whole page! Footer vibes: perl v5.42.0, dated 2024-02-02, and the manual page is YAML::Tidy(3). Bye bestie! πŸŽ€

πŸ“¦ where this page comes from