Skip to content

Conversation

@gaeljw
Copy link
Contributor

@gaeljw gaeljw commented May 29, 2025

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
Copy link
Contributor Author

gaeljw commented Jun 11, 2025

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

@nedtwigg nedtwigg merged commit 03e89b8 into diffplug:main Jul 7, 2025
16 checks passed
@nedtwigg
Copy link
Member

nedtwigg commented Jul 7, 2025

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