Skip to content

Commit 36b8215

Browse files
committed
Remove unused text param in KtLintCompatAdapter
1 parent 1c7dd53 commit 36b8215

File tree

10 files changed

+9
-15
lines changed

10 files changed

+9
-15
lines changed

lib/src/compatKtLint0Dot48Dot0/java/com/diffplug/spotless/glue/ktlint/compat/KtLintCompat0Dot48Dot0Adapter.java

-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ public Unit invoke(LintError lint, Boolean corrected) {
7474

7575
@Override
7676
public String format(
77-
String text,
7877
Path path,
7978
Path editorConfigPath,
8079
Map<String, Object> editorConfigOverrideMap) {

lib/src/compatKtLint0Dot49Dot0/java/com/diffplug/spotless/glue/ktlint/compat/KtLintCompat0Dot49Dot0Adapter.java

-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ public Unit invoke(LintError lint, Boolean corrected) {
120120

121121
@Override
122122
public String format(
123-
String text,
124123
Path path,
125124
Path editorConfigPath,
126125
Map<String, Object> editorConfigOverrideMap) {

lib/src/compatKtLint0Dot50Dot0/java/com/diffplug/spotless/glue/ktlint/compat/KtLintCompat0Dot50Dot0Adapter.java

-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ public Unit invoke(LintError lint, Boolean corrected) {
8383

8484
@Override
8585
public String format(
86-
String text,
8786
Path path,
8887
Path editorConfigPath,
8988
Map<String, Object> editorConfigOverrideMap) {

lib/src/compatKtLint1Dot0Dot0/java/com/diffplug/spotless/glue/ktlint/compat/KtLintCompat1Dot0Dot0Adapter.java

-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ public Unit invoke(LintError lint, Boolean corrected) {
8383

8484
@Override
8585
public String format(
86-
String text,
8786
Path path,
8887
Path editorConfigPath,
8988
Map<String, Object> editorConfigOverrideMap) {

lib/src/compatKtLintApi/java/com/diffplug/spotless/glue/ktlint/compat/KtLintCompatAdapter.java

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
public interface KtLintCompatAdapter {
2222

2323
String format(
24-
String text,
2524
Path path,
2625
Path editorConfigPath,
2726
Map<String, Object> editorConfigOverrideMap);

lib/src/ktlint/java/com/diffplug/spotless/glue/ktlint/KtlintFormatterFunc.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,10 @@ public KtlintFormatterFunc(String version, FileSignature editorConfigPath,
6060

6161
@Override
6262
public String applyWithFile(String unix, File file) {
63-
6463
Path absoluteEditorConfigPath = null;
6564
if (editorConfigPath != null) {
6665
absoluteEditorConfigPath = editorConfigPath.getOnlyFile().toPath();
6766
}
68-
return adapter.format(unix, file.toPath(), absoluteEditorConfigPath, editorConfigOverrideMap);
67+
return adapter.format(file.toPath(), absoluteEditorConfigPath, editorConfigOverrideMap);
6968
}
7069
}

lib/src/testCompatKtLint0Dot48Dot0/java/com/diffplug/spotless/glue/ktlint/compat/KtLintCompat0Dot48Dot0AdapterTest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public void testDefaults(@TempDir Path path) throws IOException {
3838

3939
Map<String, Object> editorConfigOverrideMap = new HashMap<>();
4040

41-
String formatted = ktLintCompat0Dot48Dot0Adapter.format(text, filePath, null, editorConfigOverrideMap);
41+
String formatted = ktLintCompat0Dot48Dot0Adapter.format(filePath, null, editorConfigOverrideMap);
4242
assertEquals("class empty_class_body\n", formatted);
4343
}
4444

@@ -54,7 +54,7 @@ public void testEditorConfigCanDisable(@TempDir Path path) throws IOException {
5454
// ktlint_filename is an invalid rule in ktlint 0.48.0
5555
editorConfigOverrideMap.put("ktlint_filename", "disabled");
5656

57-
String formatted = ktLintCompat0Dot48Dot0Adapter.format(text, filePath, null, editorConfigOverrideMap);
57+
String formatted = ktLintCompat0Dot48Dot0Adapter.format(filePath, null, editorConfigOverrideMap);
5858
assertEquals("class fails_no_semicolons {\n\tval i = 0;\n}\n", formatted);
5959
}
6060

lib/src/testCompatKtLint0Dot49Dot0/java/com/diffplug/spotless/glue/ktlint/compat/KtLintCompat0Dot49Dot0AdapterTest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public void testDefaults(@TempDir Path path) throws IOException {
3838

3939
Map<String, Object> editorConfigOverrideMap = new HashMap<>();
4040

41-
String formatted = ktLintCompat0Dot49Dot0Adapter.format(text, filePath, null, editorConfigOverrideMap);
41+
String formatted = ktLintCompat0Dot49Dot0Adapter.format(filePath, null, editorConfigOverrideMap);
4242
assertEquals("class EmptyClassBody\n", formatted);
4343
}
4444

@@ -52,7 +52,7 @@ public void testEditorConfigCanDisable(@TempDir Path path) throws IOException {
5252
editorConfigOverrideMap.put("indent_style", "tab");
5353
editorConfigOverrideMap.put("ktlint_standard_no-semi", "disabled");
5454

55-
String formatted = ktLintCompat0Dot49Dot0Adapter.format(text, filePath, null, editorConfigOverrideMap);
55+
String formatted = ktLintCompat0Dot49Dot0Adapter.format(filePath, null, editorConfigOverrideMap);
5656
assertEquals("class FailsNoSemicolons {\n\tval i = 0;\n}\n", formatted);
5757
}
5858

lib/src/testCompatKtLint0Dot50Dot0/java/com/diffplug/spotless/glue/ktlint/compat/KtLintCompat0Dot50Dot0AdapterTest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public void testDefaults(@TempDir Path path) throws IOException {
3838

3939
Map<String, Object> editorConfigOverrideMap = new HashMap<>();
4040

41-
String formatted = KtLintCompat0Dot50Dot0Adapter.format(text, filePath, null, editorConfigOverrideMap);
41+
String formatted = KtLintCompat0Dot50Dot0Adapter.format(filePath, null, editorConfigOverrideMap);
4242
assertEquals("class EmptyClassBody\n", formatted);
4343
}
4444

@@ -52,7 +52,7 @@ public void testEditorConfigCanDisable(@TempDir Path path) throws IOException {
5252
editorConfigOverrideMap.put("indent_style", "tab");
5353
editorConfigOverrideMap.put("ktlint_standard_no-semi", "disabled");
5454

55-
String formatted = KtLintCompat0Dot50Dot0Adapter.format(text, filePath, null, editorConfigOverrideMap);
55+
String formatted = KtLintCompat0Dot50Dot0Adapter.format(filePath, null, editorConfigOverrideMap);
5656
assertEquals("class FailsNoSemicolons {\n\tval i = 0;\n}\n", formatted);
5757
}
5858

lib/src/testCompatKtLint1Dot0Dot0/java/com/diffplug/spotless/glue/ktlint/compat/KtLintCompat1Dot0Dot0AdapterTest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public void testDefaults(@TempDir Path path) throws IOException {
3838

3939
Map<String, Object> editorConfigOverrideMap = new HashMap<>();
4040

41-
String formatted = KtLintCompat1Dot0Dot0Adapter.format(text, filePath, null, editorConfigOverrideMap);
41+
String formatted = KtLintCompat1Dot0Dot0Adapter.format(filePath, null, editorConfigOverrideMap);
4242
assertEquals("class EmptyClassBody\n", formatted);
4343
}
4444

@@ -52,7 +52,7 @@ public void testEditorConfigCanDisable(@TempDir Path path) throws IOException {
5252
editorConfigOverrideMap.put("indent_style", "tab");
5353
editorConfigOverrideMap.put("ktlint_standard_no-semi", "disabled");
5454

55-
String formatted = KtLintCompat1Dot0Dot0Adapter.format(text, filePath, null, editorConfigOverrideMap);
55+
String formatted = KtLintCompat1Dot0Dot0Adapter.format(filePath, null, editorConfigOverrideMap);
5656
assertEquals("class FailsNoSemicolons {\n\tval i = 0;\n}\n", formatted);
5757
}
5858

0 commit comments

Comments
 (0)