Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
joffrey-bion opened this issue Jul 5, 2023 · 2 comments
Assignees

Comments

@joffrey-bion
Copy link

joffrey-bion commented Jul 5, 2023

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

  • the versions section is the thing that we update the most, and manually, so it's nice if it's easier to access - at the top
  • plugins usually reference version numbers from the version section, and it's more natural for version references to appear after version declarations
  • the official example shows the sections in this order: versions, 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 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.

@joffrey-bion joffrey-bion changed the title Plugins section in libs.versions.toml is moved to the top by refreshVersions [plugins] section in libs.versions.toml is moved to the top by refreshVersions Jul 5, 2023
@FyiurAmron
Copy link

FyiurAmron commented Sep 19, 2023

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: littlerobots/version-catalog-update-plugin#113

@joffrey-bion
Copy link
Author

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

@LouisCAD LouisCAD self-assigned this Sep 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants