RFC: Add a tool and sigils to support automatically maintaining sort order for sorted sections. #476
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I actually started adding these because I was separately trying to write a script that would insert values in the correct places and decided that it would be easier to write one script to add things wherever and then another to sort the entire section.
These sigils are based on the ones used by https://github.com/google/keep-sorted but I've included a script that supports our use case here so that additional dependency is not required, although I do use the same sigils so in theory the other tool could be used just the same.
I only added the sort sigils on sections that I thought needed them and have not added them to any release teams.
As I was writing this RFC description, I realized that with a bit more skullduggery, it would actually be possible to use my same tool to perform the sorting using existing patterns and negating the need for explicit sigils. Stand by.