A pre-commit hook based for https://pre-commit.com, using https://www.npmjs.com/package/yml-sorter
Simply add this to your .pre-commit-config.yml:
repos:
- repo: https://github.com/stefan-hudelmaier/yml-sorter-pre-commit-hook
rev: v1.0.0
hooks:
- id: yml-sorter
files: 'some-yml-file.yml'