File tree Expand file tree Collapse file tree 1 file changed +17
-5
lines changed
testlib/src/main/java/com/diffplug/spotless Expand file tree Collapse file tree 1 file changed +17
-5
lines changed Original file line number Diff line number Diff line change @@ -26,11 +26,23 @@ class StepHarnessBase<T extends StepHarnessBase<?>> implements AutoCloseable {
26
26
27
27
protected StepHarnessBase (Formatter formatter ) {
28
28
this .formatter = Objects .requireNonNull (formatter );
29
- }
30
-
31
- public T supportsRoundTrip (boolean supportsRoundTrip ) {
32
- this .supportsRoundTrip = supportsRoundTrip ;
33
- return (T ) this ;
29
+ if (formatter .getSteps ().size () == 1 ) {
30
+ // our goal is for everything to be roundtrip serializable
31
+ // the steps to get there are
32
+ // - make every individual step round-trippable
33
+ // - make the other machinery (Formatter, LineEnding, etc) round-trippable
34
+ // - done!
35
+ //
36
+ // Right now, we're still trying to get each and every single step to be round-trippable.
37
+ // You can help by add a test below, make sure that the test for that step fails, and then
38
+ // make the test pass. `FormatterStepEqualityOnStateSerialization` is a good base class for
39
+ // easily converting a step to round-trip serialization while maintaining easy and concise
40
+ // equality code.
41
+ String onlyStepName = formatter .getSteps ().get (0 ).getName ();
42
+ if (onlyStepName .startsWith ("indentWith" )) {
43
+ supportsRoundTrip = true ;
44
+ }
45
+ }
34
46
}
35
47
36
48
protected Formatter formatter () {
You can’t perform that action at this time.
0 commit comments