Splitties / refreshVersions

Life is too short to google for dependencies and versions
https://splitties.github.io/refreshVersions/
MIT License
1.63k stars 107 forks source link

`[plugins]` section in `libs.versions.toml` is moved to the top by `refreshVersions` #690

Open joffrey-bion opened 12 months ago

joffrey-bion commented 12 months ago

🐛 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, before versions).

It would be better if plugins were at the bottom for the following reasons:

⚠️ 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 a plugins section. For instance:

[versions]

spring-boot = "3.1.1"

[plugins]

spring-boot = { id = "org.springframework.boot", version.ref = "spring-boot" }

Then run refreshVersions and notice that the plugins section moved.

FyiurAmron commented 9 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

joffrey-bion commented 9 months ago

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 :)