Scroll to navigation

YAML::Tidy(3) User Contributed Perl Documentation YAML::Tidy(3)

NAME

YAML::Tidy - Tidy YAML files

SYNOPSIS

    % 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.

It can adjust formatting without removing comments or blank lines.

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

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

FEATURES

Plans

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

AUTHOR

Tina Müller <tinita@cpan.org>

SEE ALSO

https://yamllint.readthedocs.io/en/stable/>
<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.

2024-02-02 perl v5.38.2