PHPackages                             mhujer/yaml-sort-checker - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. mhujer/yaml-sort-checker

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

mhujer/yaml-sort-checker
========================

YAML sort checker checks if your YML files are properly sorted to prevent merge conflicts

1.5.0(5y ago)2362.5k↑107.1%10[5 issues](https://github.com/mhujer/yaml-sort-checker/issues)[3 PRs](https://github.com/mhujer/yaml-sort-checker/pulls)1MITPHPPHP ~7.3 | ^8.0CI failing

Since Jan 28Pushed 3y ago5 watchersCompare

[ Source](https://github.com/mhujer/yaml-sort-checker)[ Packagist](https://packagist.org/packages/mhujer/yaml-sort-checker)[ Docs](https://github.com/mhujer/yaml-sort-checked)[ RSS](/packages/mhujer-yaml-sort-checker/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (7)Versions (7)Used By (1)

YAML file sort checker [![Build Status](https://camo.githubusercontent.com/7503acfcb84ecc3b097c8dde34acd72c8d7ae39911f68a686e614bc1956a9236/68747470733a2f2f7472617669732d63692e6f72672f6d68756a65722f79616d6c2d736f72742d636865636b65722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/mhujer/yaml-sort-checker)
==============================================================================================================================================================================================================================================================================================================================

[](#yaml-file-sort-checker-)

[![Latest Stable Version](https://camo.githubusercontent.com/cb34148577f1bf4ebaa8f52d1c5838ec08e0e3be2ed782e030470d65ad453bac/68747470733a2f2f706f7365722e707567782e6f72672f6d68756a65722f79616d6c2d736f72742d636865636b65722f76657273696f6e2e706e67)](https://packagist.org/packages/mhujer/yaml-sort-checker) [![Total Downloads](https://camo.githubusercontent.com/cff3f04e2669f7531347299147c44d53fe414b3fe988ea67f885e8b7352c0b4d/68747470733a2f2f706f7365722e707567782e6f72672f6d68756a65722f79616d6c2d736f72742d636865636b65722f646f776e6c6f6164732e706e67)](https://packagist.org/packages/mhujer/yaml-sort-checker) [![License](https://camo.githubusercontent.com/58582c0235caf454f0a7c471b42ef09c160cbb2bbea9bf586cad87d73671a739/68747470733a2f2f706f7365722e707567782e6f72672f6d68756a65722f79616d6c2d736f72742d636865636b65722f6c6963656e73652e737667)](https://packagist.org/packages/mhujer/yaml-sort-checker)

This library helps you to keep YAML file sorted to prevent unnecessary merge conflicts.

> 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/)

Typical 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).

[![yaml-sort-checker DEMO](./docs/yaml-sort-checker-demo.png)](./docs/yaml-sort-checker-demo.png)

Usage
-----

[](#usage)

1. Install the latest version with `composer require --dev mhujer/yaml-sort-checker`
2. 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).
3. Run `vendor/bin/yaml-sort-checker` (depends on where you have your Composer bin directory)
4. 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))

PHPStorm Integration
--------------------

[](#phpstorm-integration)

Until [WI-35271](https://youtrack.jetbrains.com/issue/WI-35271) is resolved, YAML sort checker can be integrated into PHPStorm by using File Watcher feature.

1. Open Settings -&gt; Tools -&gt; File Watchers
2. Add new
3. File type: `YAML`
4. Program: `PATH_TO_YOUR_PROJECT\vendor\bin\yaml-sort-checker.bat`
5. Open *Other Options* and enter: `$ProjectFileDir$` to *Working directory*
6. 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

Requirements
------------

[](#requirements)

Works with PHP 7.2 or higher and Symfony 3.4 or higher.

Submitting bugs and feature requests
------------------------------------

[](#submitting-bugs-and-feature-requests)

Bugs and feature request are tracked on [GitHub](https://github.com/mhujer/yaml-sort-checker/issues)

Author
------

[](#author)

[Martin Hujer](https://www.martinhujer.cz)

Changelog
---------

[](#changelog)

See [CHANGELOG.md](./CHANGELOG.md) for latest changes.

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance16

Infrequent updates — may be unmaintained

Popularity39

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 67.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~280 days

Recently: every ~247 days

Total

6

Last Release

2040d ago

PHP version history (3 changes)1.0.0PHP ~7.1

1.4.0PHP ~7.2

1.5.0PHP ~7.3 | ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/b232da7cbc1f54c8230ffac0c734a0e685743790ababfc00bf5913bc0bc723db?d=identicon)[mhujer](/maintainers/mhujer)

---

Top Contributors

[![mhujer](https://avatars.githubusercontent.com/u/353372?v=4)](https://github.com/mhujer "mhujer (27 commits)")[![OndraM](https://avatars.githubusercontent.com/u/793041?v=4)](https://github.com/OndraM "OndraM (10 commits)")[![hojgr](https://avatars.githubusercontent.com/u/626096?v=4)](https://github.com/hojgr "hojgr (2 commits)")[![MarlonSchultz](https://avatars.githubusercontent.com/u/14779331?v=4)](https://github.com/MarlonSchultz "MarlonSchultz (1 commits)")

---

Tags

phpstatic-analysissymfonyyamlyamlsorter

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/mhujer-yaml-sort-checker/health.svg)

```
[![Health](https://phpackages.com/badges/mhujer-yaml-sort-checker/health.svg)](https://phpackages.com/packages/mhujer-yaml-sort-checker)
```

###  Alternatives

[laravel/sail

Docker files for running a basic Laravel application.

1.9k205.7M1.3k](/packages/laravel-sail)[friendsoftypo3/content-blocks

TYPO3 CMS Content Blocks - Content Types API | Define reusable components via YAML

103519.9k53](/packages/friendsoftypo3-content-blocks)[drupal/core

Drupal is an open source content management platform powering millions of websites and applications.

21866.0M1.7k](/packages/drupal-core)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M574](/packages/shopware-core)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

9421.6k61](/packages/open-dxp-opendxp)[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

1189.8k](/packages/rcsofttech-audit-trail-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
