Is your feature request related to a problem? Please describe.
I am neurotic and would like plugins listed in .tool-versions to be alphabetized.
Describe the solution you'd like
When I have an existing .tool-versions file and do asdf <global|shell|local> <plugin> <version> I would like the added plugin to be alphabetized into the .tool-versions file instead of appended to the end of the file.
Describe workarounds you've considered
Currently I open the file after the fact and alphabetize it, or write the file manually and do asdf install or I ensure I install plugins in alphabetical order.
I recall finding myself in the obscure position where the ordering in .tool-versions mattered, so whatever solution proposed for this should also allow users to toggle the alphabetization.
I recall finding myself in the obscure position where the ordering in
.tool-versionsmattered, so whatever solution proposed for this should also allow users to toggle the alphabetization.
@jthegedus Mattered because of the code base it was in or mattered because it broke asdf?
I think it was because one plugin relied on a shim provided by another plugin and there was as resolution issue. I'll try and reproduce,
but as I recall:
.tool-versions:
pluignB 1
pluginA 1
B required a shim from A but tried to use the globally set version instead of the local. Doing:
pluginA 1
plguinB 1
resolved the issue.
I'm not familiar with every aspect of the asdf core codebase so could be mistaken, and this may have been an unrelated problem that I magically resolved.
In the meantime sort .tool-versions -o .tool-versions will do the trick
I don't believe we should alphabetize tools in the .tool-versions file because of this outstanding issue (I think this may be the one you were thinking of @jthegedus ) https://github.com/asdf-vm/asdf/issues/196
please don't arbitrarily reorder this file. There are dependencies. An example of this is golang and any tool that installs using go get
Most helpful comment
In the meantime
sort .tool-versions -o .tool-versionswill do the trick