YAML::Tidy(3)
π 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
yamltidydid 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 π₯
yamllint<https://yamllint.readthedocs.io/en/stable/>perltidyPerl::TidyYAML::LibYAML::API<https://github.com/yaml/libyaml><https://www.yaml.info/>
π COPYRIGHT AND LICENSE π
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
- opensuse-leap 16.0: perl-YAML-Tidy 0.10.0-bp160.1.11 Β· Artistic-1.0 OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms