spotless icon indicating copy to clipboard operation
spotless copied to clipboard

Progress eclipse cleanup

Open blacelle opened this issue 2 years ago • 6 comments

This revives the interest in Eclipse JDT CleanUp.

  1. The implementation is rooted in https://github.com/diffplug/spotless/compare/main...issue_292, but I would pursue the work in a forked repository.
  2. This is concurrent to my work in CleanThat, integrating various refactoring/cleanups engines (https://github.com/solven-eu/cleanthat/pull/423)
  3. Merging would probably waits the rework of Eclipse integration in Spotless https://github.com/diffplug/spotless/pull/1524
  4. This is a direct answer to https://github.com/diffplug/spotless/issues/292
  5. Unittests in _ext/eclipse-jdt are not available to myself from Intellij (they are grayed, like in case of classpath issue, hence not detected as source/unitTests). Is there a tips to get them working? (IntelliJ) image

I resynced the branch with Spotless main.

blacelle avatar Feb 25 '23 07:02 blacelle

@nedtwigg I had issues making it running in Cleanthat. Given the boilterplates around Eclipse integration, I feel preferable to drop Eclipse Cleanup from CleanThat, and get Cleanthat relying on Spotless.

As it stands, this PR holds core integration, but not availability through build options (Gradle, Maven, etc).

Do you prefer I open a separate PR for build-systems integrations ? (I will start with Eclipse). Or is it OK/preferable to have the whole thing in a single PR?

blacelle avatar Feb 25 '23 07:02 blacelle

Single PR is fine.

nedtwigg avatar Feb 25 '23 17:02 nedtwigg

This would help https://github.com/diffplug/spotless/issues/1379#issuecomment-1406192077

blacelle avatar Mar 09 '23 05:03 blacelle

Unittests in _ext/eclipse-jdt are not available to myself from Intellij (they are grayed, like in case of classpath issue, hence not detected as source/unitTests). Is there a tips to get them working? (IntelliJ)

Any idea @nedtwigg ?

blacelle avatar Mar 12 '23 14:03 blacelle

That whole project structure is about to be nuked. Everything in the _ext is becoming just a plain old sourceSet of lib-extra in #1524 which I will merge later today.

nedtwigg avatar Mar 12 '23 15:03 nedtwigg

This is still quite a long way to go.

  1. Enable customization/selection of CleanUp rules
  2. Migration to updated Eclipse. (e.g. around Indexer.getInstance().enableAutomaticIndexing(false);)
  3. There was no unitTest in the initial work for cleanup (but there was for organizeImports). Hence, I'm not confident the minimal work was working fine.

blacelle avatar Mar 13 '23 10:03 blacelle