{"id":13584685,"url":"https://github.com/mhujer/yaml-sort-checker","last_synced_at":"2025-07-11T23:32:36.506Z","repository":{"id":15551600,"uuid":"78356277","full_name":"mhujer/yaml-sort-checker","owner":"mhujer","description":"Tool for checking if the YAML config files are alphabetically sorted","archived":false,"fork":false,"pushed_at":"2023-01-03T15:07:15.000Z","size":105,"stargazers_count":23,"open_issues_count":8,"forks_count":11,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-11-06T01:41:12.446Z","etag":null,"topics":["php","static-analysis","symfony","yaml"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mhujer.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}},"created_at":"2017-01-08T16:41:34.000Z","updated_at":"2023-10-20T09:43:06.000Z","dependencies_parsed_at":"2023-01-13T18:28:55.358Z","dependency_job_id":null,"html_url":"https://github.com/mhujer/yaml-sort-checker","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhujer%2Fyaml-sort-checker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhujer%2Fyaml-sort-checker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhujer%2Fyaml-sort-checker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhujer%2Fyaml-sort-checker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mhujer","download_url":"https://codeload.github.com/mhujer/yaml-sort-checker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225769358,"owners_count":17521271,"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":["php","static-analysis","symfony","yaml"],"created_at":"2024-08-01T15:04:26.773Z","updated_at":"2024-11-21T17:18:34.452Z","avatar_url":"https://github.com/mhujer.png","language":"PHP","funding_links":[],"categories":["PHP"],"sub_categories":[],"readme":"# YAML file sort checker [![Build Status](https://travis-ci.org/mhujer/yaml-sort-checker.svg?branch=master)](https://travis-ci.org/mhujer/yaml-sort-checker)\n\n[![Latest Stable Version](https://poser.pugx.org/mhujer/yaml-sort-checker/version.png)](https://packagist.org/packages/mhujer/yaml-sort-checker) [![Total Downloads](https://poser.pugx.org/mhujer/yaml-sort-checker/downloads.png)](https://packagist.org/packages/mhujer/yaml-sort-checker) [![License](https://poser.pugx.org/mhujer/yaml-sort-checker/license.svg)](https://packagist.org/packages/mhujer/yaml-sort-checker)\n\nThis library helps you to keep YAML file sorted to prevent unnecessary merge conflicts.\n\n\u003e Check out the article I've written about the tool: [Keep your YAML files sorted with YAML sort checker](https://blog.martinhujer.cz/yaml-sort-checker/)\n\nTypical example is when two developers register a new service in `services.yml`. If they both add it to the end, it unevitably will lead to a merge conflict. However, when the services are alphabetically sorted, the probability of merge conflict is much lower (because the added services probably won't clash).\n\n![yaml-sort-checker DEMO](./docs/yaml-sort-checker-demo.png)\n\nUsage\n----\n1. Install the latest version with `composer require --dev mhujer/yaml-sort-checker`\n2. Create a configuration file `yaml-sort-checker.yml` in project root with list of the files for checking, see the  [example configuration for Symfony app](/docs/symfony-config/yaml-sort-checker.yml).\n3. Run `vendor/bin/yaml-sort-checker` (depends on where you have your Composer bin directory)\n4. Exclude the yaml keys (or even whole sections) you don't want to sort - e.g. it makes more sense to have them unsorted (see the [example configuration](/docs/symfony-config/yaml-sort-checker.yml))\n\nPHPStorm Integration\n---------------------\nUntil [WI-35271](https://youtrack.jetbrains.com/issue/WI-35271) is resolved, YAML sort checker can be integrated into PHPStorm by using File Watcher feature.\n\n1. Open Settings -\u003e Tools -\u003e File Watchers\n2. Add new\n3. File type: `YAML`\n4. Program: `PATH_TO_YOUR_PROJECT\\vendor\\bin\\yaml-sort-checker.bat`\n5. Open *Other Options* and enter: `$ProjectFileDir$` to *Working directory*\n6. Now, when you are editing YAML files, it will run the checker on every file save and will open the console if there are errors\n\nRequirements\n------------\nWorks with PHP 7.2 or higher and Symfony 3.4 or higher.\n\nSubmitting bugs and feature requests\n------------------------------------\nBugs and feature request are tracked on [GitHub](https://github.com/mhujer/yaml-sort-checker/issues)\n\nAuthor\n------\n[Martin Hujer](https://www.martinhujer.cz) \n\nChangelog\n----------\n\nSee [CHANGELOG.md](./CHANGELOG.md) for latest changes.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmhujer%2Fyaml-sort-checker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmhujer%2Fyaml-sort-checker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmhujer%2Fyaml-sort-checker/lists"}