-
Notifications
You must be signed in to change notification settings - Fork 460
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
Start making each FormatterStep
roundtrip serializable.
#1945
Conversation
…e can start testing round trip serialization on steps.
…ry step support roundtrip serialization.
…ordinates` field from `JarState`.
…hat maven-based formatters can be safely roundtripped.
@Goooler does this approach make sense? A nice thing is that we could merge these bit by bit, we don't have a hard fork situation, and once we have completed all of these we can remove |
…match `JarState`'s naming convention.
…t()` as their method.
This PR looks fantastic! Let me know when you're close to the end and I'd be more than happy to give this a proper review. |
@jbduncan and @Goooler, a code review would be very welcome if you have time, thanks! In this PR I did
I have also used this approach for some of our harder steps (eclipse), and I'm about to try the |
@nedtwigg It took me all evening to get my machine set up for Spotless again (fixing my vastly outdated fork on GitHub which was still using |
Use |
Thanks for the pointer, @Goooler! I've already fixed my fork and run |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good, and I like the incremental approach to the new roundtrip serialization mechanism. A few things from me (see the review comments), but otherwise a fantastic start!
lib-extra/src/main/java/com/diffplug/spotless/extra/EclipseBasedStepBuilder.java
Show resolved
Hide resolved
Thanks very much for this thorough review! My plan is
Until we have complete switched over to configuration cache, I'd rather not publish any releases. That creates a bit of an awkward phase, but I think we can keep it down to just one or two weeks. Can always backtrack and make some kind of bugfix release branch if we have to. |
LGTM! 👍 |
I don't like the design of the Gradle configuration cache. It puts too much burden on plugin developers, and it's too slow for end users (#987). But our workaround is a bit of a hassle, and we've had a really active contributor pool lately so maybe we have the brainpower to do the big rewrite that it would take to remove the
JvmLocalCache
workaround and fully support roundtrip serialization.This PR introduces
StepHarnessBase
, which is a mechanism for enforcing that every individual formatter step must support roundtrip serialization. It will take a while for every step to support it, so we can adjust thisStepHarnessBase
as more and more steps add support. Once every step supports it, we will enforce this requirement for all new steps.This PR also introduces
FormatterStepEqualityOnStateSerialization
. This allows us to keep the exact same equality semantics we have used so far, but it gives us more flexibility to implement serialization. Especially serialization of absolute paths without screwing up buildcache keys.