Skip to content

Allow hierarchical sort to keep simple items first #251

Description

@nyurik

When performing a hierarchical sort on a yaml file, I would like to be able to keep the keys with the deeply nested values after the ones with just a simple string/number value to improve readability:

repos:
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v5.0.0
    hooks:
      - id: check-added-large-files
      - id: check-executables-have-shebangs
      - id: check-json

rather than the current result of this:

repos:
  - repo: https://github.com/pre-commit/pre-commit-hooks
    hooks:
      - id: check-added-large-files
      - id: check-executables-have-shebangs
      - id: check-json
    rev: v5.0.0   # <----------------this gets moved to the end

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions