Skip to content

reorder_arrays sort numbers incorrectly #865

Description

@LittleBoxOfSunshine

reorder_arrays coerces values to strings before sorting, meaning arrays of numbers will be taken out of order:

Before taplo:

grpc_latency_buckets = [0.001, 0.002, 0.025, 0.3, 0.5, 1.0, 20.0, 1300.0]

After:

grpc_latency_buckets = [0.001, 0.002, 0.025, 0.3, 0.5, 1.0, 1300.0, 20.0]

While strictly speaking the doc does say:

Alphabetically reorder array values that are not separated by blank lines.

This was unexpected behavior for me. I would be willing to contribute a PR if it's agreed the behavior should change

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