spotless icon indicating copy to clipboard operation
spotless copied to clipboard

IntelliJ formatter

Open IlyasYOY opened this issue 1 year ago • 8 comments
trafficstars

Opened a draft of the https://github.com/diffplug/spotless/issues/200

Hope this looks fine!

IlyasYOY avatar Jan 23 '24 20:01 IlyasYOY

I'd also considered adding IDEA step into Kotlin extension.

Or we could make it in the next PR.

IlyasYOY avatar Jan 23 '24 20:01 IlyasYOY

The results looks strange, build fails on CI but locally everything is fine 🤔

gradle plugin-gradle:spotlessJavaCheck

IlyasYOY avatar Jan 28 '24 15:01 IlyasYOY

I'd also considered adding IDEA step into Kotlin extension.

Or we could make it in the next PR.

I'd even consider adding this formatter to the generic FormatExtension as IntelliJ IDEA can format countless languages and is not restricted to Java and/or Kotlin. (Unless @nedtwigg has objections)

simschla avatar Feb 07 '24 15:02 simschla

I'm having a hard time testing this locally. I added idea to my path which was tricky, tried to follow these

https://www.jetbrains.com/help/idea/command-line-formatter.html#8feaa497

But I'm getting Only one instance of IDEA can be run at a time.

nedtwigg avatar Feb 13 '24 00:02 nedtwigg

I'm having a hard time testing this locally. I added idea to my path which was tricky, tried to follow these

https://www.jetbrains.com/help/idea/command-line-formatter.html#8feaa497

But I'm getting Only one instance of IDEA can be run at a time.

@nedtwigg I guess that's because of you running test from inside of IDEA. I myself using neovim so I obviously didn't face this problem. I guess this might be a blocker for those who use IDEA (almost everybody). Sorry, that I didn't thought gf this problem in advance, I should have had to.

IlyasYOY avatar Feb 13 '24 21:02 IlyasYOY

That seems to be a (very old!) bug in IntelliJ :(

The listed workaround link no longer exists, but can be found on the web archive

Maybe this helps?

simschla avatar Feb 15 '24 12:02 simschla

Any update on this one?

one-harsh avatar Mar 05 '24 00:03 one-harsh