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 {
154154 /* editorConfigPath, nullable */ String .class ,
155155 /* debug */ boolean .class );
156156 Method formatterMethod = ktlintClass .getMethod ("format" , paramsClass );
157- formatterFunc = input -> {
157+ FormatterFunc . NeedsFile needsFile = ( input , file ) -> {
158158 try {
159159 Object params = constructor .newInstance (
160- /* fileName, nullable */ null ,
160+ /* fileName, nullable */ file . getName () ,
161161 /* text */ input ,
162162 /* ruleSets */ ruleSets ,
163163 /* userData */ userData ,
@@ -170,6 +170,7 @@ FormatterFunc createFormat() throws Exception {
170170 throw ThrowingEx .unwrapCause (e );
171171 }
172172 };
173+ formatterFunc = FormatterFunc .needsFile (needsFile );
173174 } else {
174175 // and its format method
175176 String formatterMethodName = isScript ? "formatScript" : "format" ;
You can’t perform that action at this time.
0 commit comments