Open Gregory108 opened 1 year ago
I second this request 🙏
If we were able to sort only at 2nd level, I could sort my .gitlab-ci.yml
keywords. That would be so useful.
Thanks.
I'm discovering the useCustomSortRecursively
. This sorts too much, and removes blank lines, which is not desirable...
So only level 2 sorting would be great !
For anyone coming here searching for a way to sort gitlab jobs attributes : waiting for the feature, I asked ChatGPT to make me a script, which works perfectly : https://dev.to/zenika/chatgpt-if-you-please-make-me-a-gitlab-jobs-attributes-sorter-3co3
+1 this would be an incredibly useful feature
Hello! Not sure it is easily possible. As far as I understand, currently the plugin sorts keys inside the last "leaves" of the
yaml
"tree" alphabetically or along with custom order.I do not want to change the insides of the keys. But I do want to sort alphabetically by the values of the "top" keys of a certain level.
I want to sort blocks of level 3 by values of
name:
s, without changing/formatting/sorting the content of the block. including other keys used in the block. And, apparently, only withing the scope of the containing block 2 - not across all blocks of the 2nd level. E.g.:Into this:
Without sorting
name
<->description
inside the folding block of level 4 and without squashing lines. Currently YAML-Sort returns:-> even with some extra
-
-ses and changes>
to|
which is okay, but it would be nicer to keep the original formatting. And (!) not sorting blocks between each other