Open joffrey-bion opened 12 months ago
TBH, I'd say it would be best if there was an option whether you want the sections to be in "standard" order, or left as-is. versions, libraries, bundles, plugins
is the official order, but, arguably, versions, plugins, libraries, bundles
makes more sense (you use plugins
in your scripts before other deps). Standardizing the default and allowing the devs to use their existing ordering doesn't seem a wrong choice here, since any order is actually valid since the input is just a TOML file, which doesn't (and can't) enforce this.
Related discussion: https://github.com/littlerobots/version-catalog-update-plugin/issues/113
Right, my biggest problem is that it doesn't keep my ordering. I believe refreshVersions should either force the standard ordering, or respect the user's ordering. If the latter, it removes the need to add any configuration and everyone is just happy :)
🐛 Describe the bug
Not a real bug per se, but an annoyance. The order of the sections in the generated
libs.versions.toml
is unusual (plugins
comes first, beforeversions
).It would be better if
plugins
were at the bottom for the following reasons:versions
section is the thing that we update the most, and manually, so it's nice if it's easier to access - at the topplugins
usually reference version numbers from theversion
section, and it's more natural for version references to appear after version declarationsversions
,libraries
,bundles
,plugins
⚠️ Current behavior
The
plugins
section is moved to the top.✅ Expected behavior
The
plugins
section stays wherever it is, or is moved to the bottom.💣 Steps to reproduce
Create a
libs.versions.toml
with aplugins
section. For instance:Then run
refreshVersions
and notice that theplugins
section moved.