{"id":15699980,"url":"https://github.com/perlpunk/yamltidy","last_synced_at":"2025-05-05T21:45:42.622Z","repository":{"id":48188664,"uuid":"291151501","full_name":"perlpunk/yamltidy","owner":"perlpunk","description":"Automatic cleanup of YAML files","archived":false,"fork":false,"pushed_at":"2025-03-21T22:55:48.000Z","size":370,"stargazers_count":8,"open_issues_count":10,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-31T00:04:31.337Z","etag":null,"topics":["formatter","lint","tidy","yaml"],"latest_commit_sha":null,"homepage":"https://perlpunk.github.io/yamltidy","language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/perlpunk.png","metadata":{"files":{"readme":"README.md","changelog":"Changes","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-08-28T21:43:36.000Z","updated_at":"2025-03-21T22:34:02.000Z","dependencies_parsed_at":"2024-01-21T15:42:36.840Z","dependency_job_id":"ba1ccde2-598f-489f-9bfa-1d5252ec919c","html_url":"https://github.com/perlpunk/yamltidy","commit_stats":{"total_commits":53,"total_committers":1,"mean_commits":53.0,"dds":0.0,"last_synced_commit":"b9f9c40cddde913619446419595b29ff367fcdb4"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perlpunk%2Fyamltidy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perlpunk%2Fyamltidy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perlpunk%2Fyamltidy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perlpunk%2Fyamltidy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/perlpunk","download_url":"https://codeload.github.com/perlpunk/yamltidy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252582334,"owners_count":21771646,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["formatter","lint","tidy","yaml"],"created_at":"2024-10-03T19:43:30.855Z","updated_at":"2025-05-05T21:45:42.603Z","avatar_url":"https://github.com/perlpunk.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"# yamltidy - Automatic cleanup of YAML files\n\nyamltidy is a formatter for YAML files.\n\nIt's is inspired by the great tools\n[yamllint](https://yamllint.readthedocs.io/en/stable/) and\n[perltidy](https://metacpan.org/pod/Perl::Tidy).\n\n* yamllint checks YAML files and reports errors and warnings.\n* perltidy automatically reformats perl programs\n* yamltidy automatically reformats YAML files\n\n## Usage\n\n```\n    % yamltidy foo.yaml\n    ---\n    a: # a comment\n      b:\n        c: d\n\n    # inplace - directly write result into original file\n    yamltidy --inplace foo.yaml\n```\n\nComplete documentation of options: [yamltidy.pod](lib/yamltidy.pod)\n\n## Installation\n\nIf you don't have a Perl CPAN client to install modules, install cpanminus:\n\n    # debian example\n    % apt-get install cpanminus\n    # openSUSE\n    % zypper install perl-App-cpanminus\n\nInstall yamltidy\n\n    % cpanm YAML::Tidy\n    # faster without running tests\n    % cpanm --notest YAML::Tidy\n\n### Local installation\n\nIf you just want to play with it, but don't want to install it globally on your\nsystem, use this:\n\n    % cpanm -l ~/localyamltidy YAML::Tidy\n    % export PERL5LIB=~/localyamltidy/lib/perl5\n    % PATH=~/localyamltidy/bin:$PATH\n\n### Use Container Image\n\n    % docker pull perlpunk/yamltidy\n    % docker run -i --rm perlpunk/yamltidy yamltidy - \u003c in.yaml\n\n## Config\n\nThe configuration is similar as for yamllint.\n\nIt's written in YAML, and it searches for it in these places:\n\n* `$PWD/.yamltidy`\n* `~/.config/yamltidy/config.yaml`\n* `~/.yamltidy`\n\nYou can pass the configuration file via the `-c`/`--config-file` switch.\n\nThe default config:\n\n    ---\n    v: v0.1\n    indentation:\n      spaces: 2\n      block-sequence-in-mapping: 0\n    trailing-spaces: fix\n    header: true\n    scalar-style:\n      default: plain\n    adjacency: 0\n\nAn indentation of two spaces is recommended.\nSequences will by default be zero-indented, because the hyphen `-` counts\nas indentation.\nThe option `block-sequence-in-mapping` can influence that.\n\nMore detailed information on configuration will follow.\n\nYou can find examples for several configurations here:\n[perlpunk.github.io/yamltidy](https://perlpunk.github.io/yamltidy)\n\n\n## Utils\n\n## Mappings for vim\n\nType `\u003cleader\u003eyt` to tidy the whole buffer:\n\n    :noremap \u003cleader\u003eyt :%!yamltidy -\u003cCR\u003e\n\nVisually select lines and type `\u003cleader\u003eyt`. The first level of indentation\nspaces will be kept.\n\n    :vnoremap \u003cleader\u003eyt :!yamltidy --partial -\u003cCR\u003e\n\n## Tests\n\nyamltidy tests are using the [YAML Test\nSuite](https://github.com/yaml/yaml-test-suite).\n\nThe tests currently make sure that at least the yamltidy output semantically\nmatches the input.\n\n## Implementation\n\nyamltidy is based on [C libyaml](https://github.com/yaml/libyaml) and\n[the perl binding YAML::LibYAML::API](https://metacpan.org/pod/YAML::LibYAML::API).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fperlpunk%2Fyamltidy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fperlpunk%2Fyamltidy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fperlpunk%2Fyamltidy/lists"}