{"id":13877902,"url":"https://github.com/Sage/yaml_normalizer","last_synced_at":"2025-07-16T13:32:50.519Z","repository":{"id":54195953,"uuid":"87073872","full_name":"Sage/yaml_normalizer","owner":"Sage","description":"Yaml Normalizer - a Psych-based YAML checker and normalizer written in Ruby","archived":false,"fork":false,"pushed_at":"2024-09-19T15:59:42.000Z","size":223,"stargazers_count":21,"open_issues_count":0,"forks_count":8,"subscribers_count":119,"default_branch":"master","last_synced_at":"2025-06-14T12:39:23.577Z","etag":null,"topics":["ruby","ruby-gem","yaml"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Sage.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"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":"2017-04-03T12:54:23.000Z","updated_at":"2025-05-12T20:42:33.000Z","dependencies_parsed_at":"2024-11-18T13:30:10.819Z","dependency_job_id":null,"html_url":"https://github.com/Sage/yaml_normalizer","commit_stats":{"total_commits":117,"total_committers":4,"mean_commits":29.25,"dds":"0.10256410256410253","last_synced_commit":"d43d1568fa5542fe9c37165867b3a3c2012e6b29"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/Sage/yaml_normalizer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sage%2Fyaml_normalizer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sage%2Fyaml_normalizer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sage%2Fyaml_normalizer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sage%2Fyaml_normalizer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Sage","download_url":"https://codeload.github.com/Sage/yaml_normalizer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sage%2Fyaml_normalizer/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265432255,"owners_count":23764057,"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":["ruby","ruby-gem","yaml"],"created_at":"2024-08-06T08:01:34.483Z","updated_at":"2025-07-16T13:32:50.208Z","avatar_url":"https://github.com/Sage.png","language":"Ruby","readme":"# Yaml Normalizer\n\n[![Build Status](https://github.com/Sage/yaml_normalizer/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/Sage/yaml_normalizer/actions/workflows/ci.yml)\n[![Maintainability](https://api.codeclimate.com/v1/badges/8dccb6c06fcd8bc0e587/maintainability)](https://codeclimate.com/github/Sage/yaml_normalizer/maintainability)\n[![Test Coverage](https://api.codeclimate.com/v1/badges/8dccb6c06fcd8bc0e587/test_coverage)](https://codeclimate.com/github/Sage/yaml_normalizer/test_coverage)\n[![Gem Version](https://badge.fury.io/rb/yaml_normalizer.svg)](https://badge.fury.io/rb/yaml_normalizer)\n\nYAML is a file format that's human-readable and very common among Ruby projects.\nThe [YAML standard](http://yaml.org/) is well-defined and supported by many\nprogramming languages. Ruby's default YAML parser and emitter is\n[Psych](https://github.com/ruby/psych#psych).\n\nYaml Normalizer follows the notion that there is a normalized YAML file\nformat. It re-formats YAML files in a way that the results closely match Psych's\noutput. Yaml Normalizer ensures that the original file and the resulting\nfile are identical regarding the resulting Hash from Psych (stable change). The\nprimary target of this project are i18n YAML files.\n\nYaml Normalizer provides\n* **Alphabetic Ordering**\n  * to improve (human-)readability and maintainability,\n  * to avoid duplicate keys,\n  * to minimize effort when resolving merge conflicts in YAML files\n* **Limited Line Length**\n  * to improve (human-)readability and maintainability\n* **Non-breaking Changes only**\n  * to ensure changes do not impact functional parts of the application.\n    Yaml Normalizer considers changing the order of YAML file entries as\n    non-breaking,\n  * to build maximum trust in Yaml Normalizer and its generated YAML files,\n  * to avoid the need of manual reviews.\n\nYaml Normalizer can be used in frameworks like Rails, Sinatra or Cuba, but\nit runs stand-alone as well.\n\n## Installation\n    gem install yaml_normalizer\n\n## Usage\n### Use executable files\nYaml Normalizer provides you with two executables: `yaml_normalize` and `yaml_check`.\nTo check and normalize ´a_yaml_file.yml´, run:\n\n    yaml_check a_yaml_file.yml\n    yaml_normalize a_yaml_file.yml\n\nPrint the installed version of Yaml Normalizer:\n\n    yaml_check --version\n\nPrint help messages for ´yaml_check´ and `yaml_normalize`:\n\n    yaml_check --help\n    yaml_normalize --help\n\n### Include Yaml Normalizer rake tasks\nIn your Gemfile, add\n\n      gem 'yaml_normalizer', require: false\n\nIn a Rails context, you might want to only add it to `:development` and `:test` groups.\n\nIn your Rakefile, add\n\n    require 'yaml_normalizer/rake_task'\n    YamlNormalizer::RakeTask.new do |config|\n      yamls = Dir['**/*.yml']  # TODO: Select relevant YAML files in your project.\n      config.files = yamls\n    end\n\nThis will give you two additional rake task (`rake -T`)\n\n    rake yaml:check      # Check if configured YAML files are normalized\n    rake yaml:normalize  # Normalize configured YAML files\n\n## Development\nStart developing Yaml Normalizer by installing the following dependencies:\n* [git](https://git-scm.com/downloads) (version control)\n* [Ruby](https://www.ruby-lang.org/en/documentation/installation/) (programming language)\n* [RubyGems](https://rubygems.org/pages/download) (package manager for Ruby)\n* [Bundler](http://bundler.io/) (dependency manager for RubyGems)\n\n### Set up Yaml Normalizer\n    git clone git@github.com:Sage/yaml_normalizer.git\n    cd yaml_normalizer/\n    bundle install\n\n### List available rake tasks\n    bundle exec rake -T\n```\nrake ci                       # Continuous integration test suite (DEFAULT)\nrake flog                     # Analyze for code complexity in: lib\nrake inch                     # Check documentation coverage\nrake mutant                   # Mutation testing to check mutation coverage of current RSpec test suite\nrake rubocop                  # Run RuboCop\nrake rubocop:autocorrect      # Autocorrect RuboCop offenses (only when it's safe)\nrake rubocop:autocorrect_all  # Autocorrect RuboCop offenses (safe and unsafe)\nrake spec                     # Run RSpec code examples\nrake yard                     # Generate YARD Documentation\n```\n\n### Generate documentation locally using Yard\n    bundle exec rake yard\nAfter generating yard documentation, open generated index.html located in `doc/` in your browser.\n\n### Test documentation quality using Inch\n    bundle exec rake inch\n    inch list --all\nThis task applies static code analysis to measure documentation quality. Inch also suggests improvements.\n\n### Run RSpec\n    bundle exec rake spec\n    rspec\n[RSpec](https://rubygems.org/gems/rspec) is a testing framework for Ruby. Running this task executes all tests located in `spec/`.\n\n### Check and Correct static code metrics using Rubocop\n    bundle exec rake rubocop\n    rubocop\n\n    bundle exec rake rubocop:autocorrect\n    rubocop -a\n\n    bundle exec rake rubocop:autocorrect_all\n    rubocop -A\n[Rubocop](https://rubygems.org/gems/rubocop) is a static code analyzer that checks for code quality and style issues.\n\n### Run Flog (check complexity)\n    bundle exec rake flog\n[Flog](https://rubygems.org/gems/flog) is a static code analyzer that checks for code complexity.\n\n### Run Guard\n    bundle exec guard\n[Guard](https://rubygems.org/gems/guard) keeps track of file changes and automatically runs tests related to updated files.\n\n### Run continuous integration test suite\n    bundle exec rake\nRunning this task executes the following tasks: ´ci_spec´ ´inch´ ´ci_flog´ ´rubocop`\n\n### Test Tests using mutant (requires mutant-license)\n    bundle exec rake mutant\n\n## Contributing\nBug reports and pull requests are welcome on GitHub at\nhttps://github.com/Sage/yaml_normalizer.\n\n### Engineering Standards\nWe want to keep engineering standards high and use code reviews and test tools\nto help with that. Yaml Normalizer is designed to have no side effects,\nespecially regarding Ruby Core and Standard Lib implementation. Also, we want to\nkeep simplecov, rubocop, flog, inch and mutant happy. We will add more details\non PRs if needed.\n\n## License\nYaml Normalizer is available as open source under the terms of the\n[Apache-2.0 licence](https://github.com/Sage/yaml_normalizer/blob/master/LICENSE).\n\nCopyright (c) 2017-2019 Sage Group Plc. All rights reserved.\n","funding_links":[],"categories":["Ruby"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSage%2Fyaml_normalizer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSage%2Fyaml_normalizer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSage%2Fyaml_normalizer/lists"}