File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed
lib/src/ktlint/java/com/diffplug/spotless/glue/ktlint Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -43,18 +43,20 @@ public class KtlintFormatterFunc implements FormatterFunc.NeedsFile {
43
43
public KtlintFormatterFunc (boolean isScript , Map <String , String > userData ) {
44
44
rulesets = Collections .singletonList (new StandardRuleSetProvider ().get ());
45
45
this .userData = userData ;
46
- formatterCallback = new Function2 <LintError , Boolean , Unit >() {
47
- @ Override
48
- public Unit invoke (LintError lint , Boolean corrected ) {
49
- if (!corrected ) {
50
- throw new AssertionError ("Error on line: " + lint .getLine () + ", column: " + lint .getCol () + "\n " + lint .getDetail ());
51
- }
52
- return null ;
53
- }
54
- };
46
+ formatterCallback = new FormatterCallback ();
55
47
this .isScript = isScript ;
56
48
}
57
49
50
+ static class FormatterCallback implements Function2 <LintError , Boolean , Unit > {
51
+ @ Override
52
+ public Unit invoke (LintError lint , Boolean corrected ) {
53
+ if (!corrected ) {
54
+ throw new AssertionError ("Error on line: " + lint .getLine () + ", column: " + lint .getCol () + "\n " + lint .getDetail ());
55
+ }
56
+ return null ;
57
+ }
58
+ }
59
+
58
60
@ Override
59
61
public String applyWithFile (String unix , File file ) throws Exception {
60
62
return KtLint .INSTANCE .format (new Params (
You can’t perform that action at this time.
0 commit comments