Skip to content

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

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

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
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
1 participant