Skip to content

Commit 0bd1d06

Browse files
committed
Remove unused text param in KtLintCompatAdapter
1 parent 8bbed1f commit 0bd1d06

File tree

10 files changed

+17
-23
lines changed

10 files changed

+17
-23
lines changed

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

Lines changed: 0 additions & 1 deletion
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

Lines changed: 0 additions & 1 deletion
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

Lines changed: 0 additions & 1 deletion
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

Lines changed: 0 additions & 1 deletion
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

Lines changed: 0 additions & 1 deletion
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

Lines changed: 1 addition & 2 deletions
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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,19 @@ public class KtLintCompat0Dot48Dot0AdapterTest {
3333
@Test
3434
public void testDefaults(@TempDir Path path) throws IOException {
3535
KtLintCompat0Dot48Dot0Adapter ktLintCompat0Dot48Dot0Adapter = new KtLintCompat0Dot48Dot0Adapter();
36-
String text = loadAndWriteText(path, "empty_class_body.kt");
36+
loadAndWriteText(path, "empty_class_body.kt");
3737
final Path filePath = Paths.get(path.toString(), "empty_class_body.kt");
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

4545
@Test
4646
public void testEditorConfigCanDisable(@TempDir Path path) throws IOException {
4747
KtLintCompat0Dot48Dot0Adapter ktLintCompat0Dot48Dot0Adapter = new KtLintCompat0Dot48Dot0Adapter();
48-
String text = loadAndWriteText(path, "fails_no_semicolons.kt");
48+
loadAndWriteText(path, "fails_no_semicolons.kt");
4949
final Path filePath = Paths.get(path.toString(), "fails_no_semicolons.kt");
5050

5151
Map<String, Object> editorConfigOverrideMap = new HashMap<>();
@@ -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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,26 +33,26 @@ public class KtLintCompat0Dot49Dot0AdapterTest {
3333
@Test
3434
public void testDefaults(@TempDir Path path) throws IOException {
3535
KtLintCompat0Dot49Dot0Adapter ktLintCompat0Dot49Dot0Adapter = new KtLintCompat0Dot49Dot0Adapter();
36-
String text = loadAndWriteText(path, "EmptyClassBody.kt");
36+
loadAndWriteText(path, "EmptyClassBody.kt");
3737
final Path filePath = Paths.get(path.toString(), "EmptyClassBody.kt");
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

4545
@Test
4646
public void testEditorConfigCanDisable(@TempDir Path path) throws IOException {
4747
KtLintCompat0Dot49Dot0Adapter ktLintCompat0Dot49Dot0Adapter = new KtLintCompat0Dot49Dot0Adapter();
48-
String text = loadAndWriteText(path, "FailsNoSemicolons.kt");
48+
loadAndWriteText(path, "FailsNoSemicolons.kt");
4949
final Path filePath = Paths.get(path.toString(), "FailsNoSemicolons.kt");
5050

5151
Map<String, Object> editorConfigOverrideMap = new HashMap<>();
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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,26 +33,26 @@ public class KtLintCompat0Dot50Dot0AdapterTest {
3333
@Test
3434
public void testDefaults(@TempDir Path path) throws IOException {
3535
KtLintCompat0Dot50Dot0Adapter KtLintCompat0Dot50Dot0Adapter = new KtLintCompat0Dot50Dot0Adapter();
36-
String text = loadAndWriteText(path, "EmptyClassBody.kt");
36+
loadAndWriteText(path, "EmptyClassBody.kt");
3737
final Path filePath = Paths.get(path.toString(), "EmptyClassBody.kt");
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

4545
@Test
4646
public void testEditorConfigCanDisable(@TempDir Path path) throws IOException {
4747
KtLintCompat0Dot50Dot0Adapter KtLintCompat0Dot50Dot0Adapter = new KtLintCompat0Dot50Dot0Adapter();
48-
String text = loadAndWriteText(path, "FailsNoSemicolons.kt");
48+
loadAndWriteText(path, "FailsNoSemicolons.kt");
4949
final Path filePath = Paths.get(path.toString(), "FailsNoSemicolons.kt");
5050

5151
Map<String, Object> editorConfigOverrideMap = new HashMap<>();
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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,26 +33,26 @@ public class KtLintCompat1Dot0Dot0AdapterTest {
3333
@Test
3434
public void testDefaults(@TempDir Path path) throws IOException {
3535
KtLintCompat1Dot0Dot0Adapter KtLintCompat1Dot0Dot0Adapter = new KtLintCompat1Dot0Dot0Adapter();
36-
String text = loadAndWriteText(path, "EmptyClassBody.kt");
36+
loadAndWriteText(path, "EmptyClassBody.kt");
3737
final Path filePath = Paths.get(path.toString(), "EmptyClassBody.kt");
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

4545
@Test
4646
public void testEditorConfigCanDisable(@TempDir Path path) throws IOException {
4747
KtLintCompat1Dot0Dot0Adapter KtLintCompat1Dot0Dot0Adapter = new KtLintCompat1Dot0Dot0Adapter();
48-
String text = loadAndWriteText(path, "FailsNoSemicolons.kt");
48+
loadAndWriteText(path, "FailsNoSemicolons.kt");
4949
final Path filePath = Paths.get(path.toString(), "FailsNoSemicolons.kt");
5050

5151
Map<String, Object> editorConfigOverrideMap = new HashMap<>();
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)