Skip to content

✨ feat(scalafmt): enforce version consistency between library and config file - #2499

Merged
nedtwigg merged 4 commits into
diffplug:mainfrom
gaeljw:gh2460
Jul 7, 2025
Merged

nedtwigg merged 4 commits into
diffplug:mainfrom
gaeljw:gh2460

Conversation

@gaeljw

@gaeljw gaeljw commented May 29, 2025 •

Copy link
Copy Markdown
Contributor

Closes #2460

As suggested in #2460 (comment), this is a first step to raise awareness to users that the version declared in the config file is not used.

We might work on dynamically loading the right Scalafmt JAR in another PR.

I've tested this locally on a project of mine and this works, when versions are not aligned I got the following error:

[ERROR] Failed to execute goal com.diffplug.spotless:spotless-maven-plugin:2.44.5-SNAPSHOT:check (default-cli) on project xxx: Unable to check file /home/xxx/src/test/scala/bdd/utils/DataTableTypeMappings.scala: java.lang.reflect.InvocationTargetException: Spotless is using 2.7.5 but the config file declares 3.9.6. Both must match. Update the version declared in the plugin's settings and/or the config file. 

@gaeljw
gaeljw marked this pull request as draft May 29, 2025 15:16
@gaeljw
gaeljw marked this pull request as ready for review May 29, 2025 15:33
@gaeljw

gaeljw commented Jun 11, 2025

Copy link
Copy Markdown
Contributor Author

@nedtwigg no rush but any chance you could have a look at this?

@nedtwigg
nedtwigg merged commit 03e89b8 into diffplug:main Jul 7, 2025
@nedtwigg

nedtwigg commented Jul 7, 2025

Copy link
Copy Markdown
Member

Released in plugin-gradle 7.1.0 and plugin-maven 2.45.0.

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

Successfully merging this pull request may close these issues.

scalafmt: version from the config file is not dynamically used

2 participants