Skip to content

Commit 9af4880

Browse files
committed
DirtyState now uses LintPolicy.legacyBehavior unless you passed in the ValuePerStep explicitly. That's enough to bring most of our tests back to life.
1 parent 53e31f5 commit 9af4880

File tree

5 files changed

+4
-19
lines changed

5 files changed

+4
-19
lines changed

lib/src/main/java/com/diffplug/spotless/DirtyState.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,10 @@ public static DirtyState of(Formatter formatter, File file, byte[] rawBytes) {
7878
}
7979

8080
public static DirtyState of(Formatter formatter, File file, byte[] rawBytes, String raw) {
81-
return of(formatter, file, rawBytes, raw, new ValuePerStep<>(formatter));
81+
var valuePerStep = new ValuePerStep<Throwable>(formatter);
82+
DirtyState state = of(formatter, file, rawBytes, raw, valuePerStep);
83+
LintPolicy.legacyBehavior(formatter, file, valuePerStep);
84+
return state;
8285
}
8386

8487
public static DirtyState of(Formatter formatter, File file, byte[] rawBytes, String raw, ValuePerStep<Throwable> exceptionPerStep) {

plugin-gradle/src/test/java/com/diffplug/gradle/spotless/BiomeIntegrationTest.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,9 @@
1919
import static org.junit.jupiter.api.Assertions.assertEquals;
2020
import static org.junit.jupiter.api.Assertions.assertTrue;
2121

22-
import org.junit.jupiter.api.Disabled;
2322
import org.junit.jupiter.api.Test;
2423
import org.owasp.encoder.Encode;
2524

26-
import com.diffplug.spotless.tag.ForLintRefactor;
27-
2825
class BiomeIntegrationTest extends GradleIntegrationHarness {
2926
/**
3027
* Tests that biome can be used as a JSON formatting step, using biome 1.8.3
@@ -376,8 +373,6 @@ void failureWhenExeNotFound() throws Exception {
376373
* @throws Exception When a test failure occurs.
377374
*/
378375
@Test
379-
@Disabled
380-
@ForLintRefactor
381376
void failureWhenNotParseable() throws Exception {
382377
setFile("build.gradle").toLines(
383378
"plugins {",

plugin-gradle/src/test/java/com/diffplug/gradle/spotless/KotlinExtensionTest.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,8 @@
2020
import java.io.File;
2121
import java.io.IOException;
2222

23-
import org.junit.jupiter.api.Disabled;
2423
import org.junit.jupiter.api.Test;
2524

26-
import com.diffplug.spotless.tag.ForLintRefactor;
27-
2825
class KotlinExtensionTest extends GradleIntegrationHarness {
2926
private static final String HEADER = "// License Header";
3027
private static final String HEADER_WITH_YEAR = "// License Header $YEAR";
@@ -170,8 +167,6 @@ void testSetEditorConfigCanOverrideEditorConfigFile() throws IOException {
170167
}
171168

172169
@Test
173-
@Disabled
174-
@ForLintRefactor
175170
void withCustomRuleSetApply() throws IOException {
176171
setFile("build.gradle.kts").toLines(
177172
"plugins {",

plugin-maven/src/test/java/com/diffplug/spotless/maven/biome/BiomeMavenTest.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,9 @@
2020
import static org.junit.jupiter.api.Assertions.assertTrue;
2121
import static org.owasp.encoder.Encode.forXml;
2222

23-
import org.junit.jupiter.api.Disabled;
2423
import org.junit.jupiter.api.Test;
2524

2625
import com.diffplug.spotless.maven.MavenIntegrationHarness;
27-
import com.diffplug.spotless.tag.ForLintRefactor;
2826

2927
/**
3028
* Tests for the Biome formatter used via the Maven spotless plugin.
@@ -225,8 +223,6 @@ void failureWhenExeNotFound() throws Exception {
225223
* @throws Exception When a test failure occurs.
226224
*/
227225
@Test
228-
@Disabled
229-
@ForLintRefactor
230226
void failureWhenNotParseable() throws Exception {
231227
writePomWithBiomeSteps("**/*.js", "<biome><version>1.2.0</version><language>json</language></biome>");
232228
setFile("biome_test.js").toResource("biome/js/fileBefore.js");

plugin-maven/src/test/java/com/diffplug/spotless/maven/kotlin/KtlintTest.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,10 @@
1717

1818
import static org.junit.jupiter.api.Assertions.assertTrue;
1919

20-
import org.junit.jupiter.api.Disabled;
2120
import org.junit.jupiter.api.Test;
2221

2322
import com.diffplug.spotless.ProcessRunner;
2423
import com.diffplug.spotless.maven.MavenIntegrationHarness;
25-
import com.diffplug.spotless.tag.ForLintRefactor;
2624

2725
class KtlintTest extends MavenIntegrationHarness {
2826
@Test
@@ -80,8 +78,6 @@ void testSetEditorConfigCanOverrideEditorConfigFile() throws Exception {
8078
}
8179

8280
@Test
83-
@Disabled
84-
@ForLintRefactor
8581
void testWithCustomRuleSetApply() throws Exception {
8682
writePomWithKotlinSteps("<ktlint>\n" +
8783
" <customRuleSets>\n" +

0 commit comments

Comments
 (0)