As it says on the tin: dotnet tool --install should insert tools into dotnet-tools.json in some type of deterministic order (I suggest via some type of alphabetical/pseudo-alphabetical order).
Our use case involves us with several 10's of dotnet tool packages (more every day as we dive in deeper into the system). Due to the size of our code base and multiple branches we work hard to avoid merge conflicts resulting in the race to push.
When dealing with dotnet tool it is frustrating to have to work around the non-deterministic ordering when inserting new tools due to the various merge conflicts that arise.
This still inserts in whatever order we happen to do.
In addition I cannot recall if JSON requires that the comma for an array be on the same line, but if that is not required it'd be great to not have that, this way when you add to the last element you don't get a garbage merge conflict due to , being added.
Work Arounds
Since its just a JSON file you can use any JSON sorting abilities you have, or baring that we rebuild the entire file by dumping the installed tools, sorting based on name, and then readding them (not super efficient, but good enough).
As it says on the tin:
dotnet tool --install
should insert tools intodotnet-tools.json
in some type of deterministic order (I suggest via some type of alphabetical/pseudo-alphabetical order).Our use case involves us with several 10's of
dotnet tool
packages (more every day as we dive in deeper into the system). Due to the size of our code base and multiple branches we work hard to avoid merge conflicts resulting in the race to push.When dealing with
dotnet tool
it is frustrating to have to work around the non-deterministic ordering when inserting new tools due to the various merge conflicts that arise.Steps to Reproduce
Expected Result
Instead as of:
This still inserts in whatever order we happen to do.
In addition I cannot recall if JSON requires that the comma for an array be on the same line, but if that is not required it'd be great to not have that, this way when you add to the last element you don't get a garbage merge conflict due to
,
being added.Work Arounds
Since its just a JSON file you can use any JSON sorting abilities you have, or baring that we rebuild the entire file by dumping the installed tools, sorting based on name, and then readding them (not super efficient, but good enough).
Thank you