File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
main/java/com/diffplug/gradle/spotless
test/java/com/diffplug/gradle/spotless Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 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.
4545import com .diffplug .spotless .Formatter ;
4646import com .diffplug .spotless .Lint ;
4747import com .diffplug .spotless .LintState ;
48+ import com .diffplug .spotless .LintSuppression ;
4849import 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." );
Original file line number Diff line number Diff line change 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.
1515 */
1616package com .diffplug .gradle .spotless ;
1717
18- import static com .diffplug .gradle .spotless .FormatExtension .relativize ;
19-
2018import java .io .File ;
2119import java .io .IOException ;
2220
2624import org .junit .jupiter .api .BeforeEach ;
2725import org .junit .jupiter .api .Test ;
2826
27+ import com .diffplug .spotless .LintSuppression ;
2928import com .diffplug .spotless .ResourceHarness ;
3029import 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}
You can’t perform that action at this time.
0 commit comments