ragurney / spotless-intellij-gradle

An IntelliJ plugin to allow running the Spotless gradle task from within the IDE.
MIT License
38 stars 14 forks source link

Issue while executing the "Reformat Code with Spotless" #21

Closed SebKiller closed 2 years ago

SebKiller commented 2 years ago

I installed the spotless plugin through the plugins repository in IntelliJ and if I execute the "Reformat Code with Spotless" on one of my Java files in my project, I get the following error message: "Unknown command-line option '--no-configuration-cache'."

The logs give the following: 17:23:09: Executing 'spotlessApply -PspotlessIdeHook="somepath/file.java" --no-configuration-cache'... 17:23:09: Execution finished 'spotlessApply -PspotlessIdeHook="somepath/file.java" --no-configuration-cache'.

nedtwigg commented 2 years ago

You must be using a version of Gradle before 6.6. If you update to Gradle >= 6.6 this error will go away. Ideally, the plugin would parse the Gradle version to leave the flag off for older versions of Gradle.

ragurney commented 2 years ago

Thanks for reporting @SebKiller and thanks @nedtwigg for the response! This has been an issue for me too, and I think I might have time later this week to look into adding that parsing functionality, but contributions are always welcome ❤️

SebKiller commented 2 years ago

I confirm that I was using Gradle 5.6.4 and now that I upgraded to 6.9.2, it went away 👍

ragurney commented 2 years ago

Once ☝️ is released this issue should be fixed for future users. Thanks for reporting.