File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
lib/src/main/java/com/diffplug/spotless/kotlin Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -154,10 +154,10 @@ FormatterFunc createFormat() throws Exception {
154
154
/* editorConfigPath, nullable */ String .class ,
155
155
/* debug */ boolean .class );
156
156
Method formatterMethod = ktlintClass .getMethod ("format" , paramsClass );
157
- formatterFunc = input -> {
157
+ FormatterFunc . NeedsFile needsFile = ( input , file ) -> {
158
158
try {
159
159
Object params = constructor .newInstance (
160
- /* fileName, nullable */ null ,
160
+ /* fileName, nullable */ file . getName () ,
161
161
/* text */ input ,
162
162
/* ruleSets */ ruleSets ,
163
163
/* userData */ userData ,
@@ -170,6 +170,7 @@ FormatterFunc createFormat() throws Exception {
170
170
throw ThrowingEx .unwrapCause (e );
171
171
}
172
172
};
173
+ formatterFunc = FormatterFunc .needsFile (needsFile );
173
174
} else {
174
175
// and its format method
175
176
String formatterMethodName = isScript ? "formatScript" : "format" ;
You can’t perform that action at this time.
0 commit comments