Skip to content

Commit bb7f61a

Browse files
EdgarTwiggEdgarTwigg
authored andcommitted
Missed some spots.
1 parent 479fca8 commit bb7f61a

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

plugin-gradle/src/main/java/com/diffplug/gradle/spotless/SpotlessTaskImpl.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016-2024 DiffPlug
2+
* Copyright 2016-2025 DiffPlug
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -45,6 +45,7 @@
4545
import com.diffplug.spotless.Formatter;
4646
import com.diffplug.spotless.Lint;
4747
import com.diffplug.spotless.LintState;
48+
import com.diffplug.spotless.LintSuppression;
4849
import com.diffplug.spotless.extra.GitRatchet;
4950

5051
@CacheableTask
@@ -101,7 +102,7 @@ public void performAction(InputChanges inputs) throws Exception {
101102
for (FileChange fileChange : inputs.getFileChanges(target)) {
102103
File input = fileChange.getFile();
103104
File projectDir = getProjectDir().get().getAsFile();
104-
String relativePath = FormatExtension.relativize(projectDir, input);
105+
String relativePath = LintSuppression.relativizeAsUnix(projectDir, input);
105106
if (relativePath == null) {
106107
throw new IllegalArgumentException(StringPrinter.buildString(printer -> {
107108
printer.println("Spotless error! All target files must be within the project dir.");

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016-2021 DiffPlug
2+
* Copyright 2016-2025 DiffPlug
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -15,8 +15,6 @@
1515
*/
1616
package com.diffplug.gradle.spotless;
1717

18-
import static com.diffplug.gradle.spotless.FormatExtension.relativize;
19-
2018
import java.io.File;
2119
import java.io.IOException;
2220

@@ -26,6 +24,7 @@
2624
import org.junit.jupiter.api.BeforeEach;
2725
import org.junit.jupiter.api.Test;
2826

27+
import com.diffplug.spotless.LintSuppression;
2928
import com.diffplug.spotless.ResourceHarness;
3029
import com.diffplug.spotless.TestProvisioner;
3130

@@ -51,7 +50,7 @@ void absolutePathDoesntWork() throws IOException {
5150
void relativePathDoes() throws IOException {
5251
File someFile = setFile("someFolder/someFile").toContent("");
5352
File someFolder = someFile.getParentFile();
54-
fileTree.exclude(relativize(rootFolder(), someFolder));
53+
fileTree.exclude(LintSuppression.relativizeAsUnix(rootFolder(), someFolder));
5554
Assertions.assertThat(fileTree).containsExactlyInAnyOrder();
5655
}
5756
}

0 commit comments

Comments
 (0)