You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(it would maintain the missing comma in the same position) but if i wanted to, i could do a pre-sort by prefix order, but that seems like too much of a special-case and trying to again put language knowledge into the system.
tl;dr: accept a regexp with two subgroups. one subgroup is sticky to the sortable group, and the other is sticky to the position (anything outside the subgroups is dropped). In this example the comma would be sticky to the group position and the comment sticky to the sortable group.
There's some logic in keep-sorted to try and gracefully handle lists that don't have a final trailing comma like
would become the following (commas added and removed as necessary)
keep-sorted/keepsorted/block.go
Lines 338 to 340 in 62dd144
There's a couple edge cases here that aren't handled very well right now
Trailing comments after a comma
This prevents the special case from being triggered
would become
Trailing comment after the last line
The logic still triggers, but we add a comma to the comment
would become
The text was updated successfully, but these errors were encountered: