PHPackages                             exoticca/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. exoticca/yaml-sort-checker

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

exoticca/yaml-sort-checker
==========================

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

1.7.0(4mo ago)04.9k↓20.6%MITPHPPHP ~7.3 | ^8.0 | ^8.3

Since Jan 28Pushed 4mo agoCompare

[ Source](https://github.com/exoticcaengineering/yaml-sort-checker)[ Packagist](https://packagist.org/packages/exoticca/yaml-sort-checker)[ Docs](https://github.com/exoticcaengineering/yaml-sort-checker)[ RSS](/packages/exoticca-yaml-sort-checker/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (5)Versions (9)Used By (0)

YAML file sort checker
======================

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

[![Latest Stable Version](https://camo.githubusercontent.com/888a60bb44c2f2940499ad9e7f848853e130ab159cc74d96160940104fffa19c/68747470733a2f2f706f7365722e707567782e6f72672f65786f74696363612f79616d6c2d736f72742d636865636b65722f76657273696f6e2e706e67)](https://packagist.org/packages/exoticca/yaml-sort-checker) [![Total Downloads](https://camo.githubusercontent.com/d7f8437bf4e211e46fb3d9628ffe19d0997302fe959d2def0add7554a329ef8f/68747470733a2f2f706f7365722e707567782e6f72672f65786f74696363612f79616d6c2d736f72742d636865636b65722f646f776e6c6f6164732e706e67)](https://packagist.org/packages/exoticca/yaml-sort-checker) [![License](https://camo.githubusercontent.com/4c2ae8f6335938426ea1714e45398cad39b8d6c1a1f837e6366925851d66326b/68747470733a2f2f706f7365722e707567782e6f72672f65786f74696363612f79616d6c2d736f72742d636865636b65722f6c6963656e73652e737667)](https://packagist.org/packages/exoticca/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 exoticca/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 8.3 or higher and Symfony 3.4 or higher.

Optional Configuration
----------------------

[](#optional-configuration)

**case-sensitive**

`true` - sort checker will expect upercase to be placed before lowercase

`false` - sort checker will ignore casing *(default value)*

Development
-----------

[](#development)

```
# Install composer dependencies
docker compose run --rm composer composer install
# Run tests
docker compose run --rm php vendor/bin/phpunit
```

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

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

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

Author
------

[](#author)

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

Changelog
---------

[](#changelog)

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

###  Health Score

53

—

FairBetter than 97% of packages

Maintenance77

Regular maintenance activity

Popularity24

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity83

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 54% 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 ~467 days

Recently: every ~560 days

Total

8

Last Release

127d ago

PHP version history (4 changes)1.0.0PHP ~7.1

1.4.0PHP ~7.2

1.5.0PHP ~7.3 | ^8.0

1.7.0PHP ~7.3 | ^8.0 | ^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/1b07d764bb99d4e262ca0c30295c7213c4ac49024d106e4270b91e119e65b6b1?d=identicon)[sysadmin@exoticca.com](/maintainers/sysadmin@exoticca.com)

---

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)")[![marlonsed](https://avatars.githubusercontent.com/u/16228923?v=4)](https://github.com/marlonsed "marlonsed (6 commits)")[![DeXteRrBDN](https://avatars.githubusercontent.com/u/25362196?v=4)](https://github.com/DeXteRrBDN "DeXteRrBDN (4 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

yamlsorter

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[spatie/yaml-front-matter

A to the point yaml front matter parser

3411.8M68](/packages/spatie-yaml-front-matter)[pragmarx/yaml

Load your Laravel config files using yaml

1152.8M29](/packages/pragmarx-yaml)[mhujer/yaml-sort-checker

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

2361.6k](/packages/mhujer-yaml-sort-checker)[dragon-code/codestyler

A tool to automatically fix Coding Style Standards issues by The Dragon Code.

291.8M16](/packages/dragon-code-codestyler)[sspooky13/yaml-standards

Standards for yaml files

11518.3k3](/packages/sspooky13-yaml-standards)[thunderer/serializard

Flexible serializer

2767.3k1](/packages/thunderer-serializard)

PHPackages © 2026

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