Skip to content

Commit bbe2c80

Browse files
committed
Make ScalafmtFormatterFunc use the correct FormatterFunc.NeedsFile.
1 parent 1fff681 commit bbe2c80

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

lib/src/scalafmt/java/com/diffplug/spotless/glue/scalafmt/ScalafmtFormatterFunc.java

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
import scala.collection.immutable.Set$;
3131

32-
public class ScalafmtFormatterFunc implements FormatterFunc {
32+
public class ScalafmtFormatterFunc implements FormatterFunc.NeedsFile {
3333
private final ScalafmtConfig config;
3434

3535
public ScalafmtFormatterFunc(FileSignature configSignature) throws Exception {
@@ -48,12 +48,7 @@ public ScalafmtFormatterFunc(FileSignature configSignature) throws Exception {
4848
}
4949

5050
@Override
51-
public String apply(String input) {
52-
return Scalafmt.format(input, config, Set$.MODULE$.empty()).get();
53-
}
54-
55-
@Override
56-
public String apply(String input, File file) {
57-
return Scalafmt.format(input, config, Set$.MODULE$.empty(), file.getAbsolutePath()).get();
51+
public String applyWithFile(String unix, File file) throws Exception {
52+
return Scalafmt.format(unix, config, Set$.MODULE$.empty()).get();
5853
}
5954
}

0 commit comments

Comments
 (0)