@@ -70,11 +70,10 @@ public KtfmtConfig ktfmt(String version) {
70
70
protected abstract boolean isScript ();
71
71
72
72
public class DiktatConfig {
73
-
74
73
private final String version ;
75
74
private FileSignature config ;
76
75
77
- DiktatConfig (String version ) {
76
+ private DiktatConfig (String version ) {
78
77
Objects .requireNonNull (version , "version" );
79
78
this .version = version ;
80
79
addStep (createStep ());
@@ -97,24 +96,18 @@ private FormatterStep createStep() {
97
96
}
98
97
99
98
public class KtfmtConfig {
100
- final String version ;
101
- KtfmtStep .Style style ;
102
- KtfmtStep .KtfmtFormattingOptions options ;
99
+ private final String version ;
100
+ private KtfmtStep .Style style ;
101
+ private KtfmtStep .KtfmtFormattingOptions options ;
103
102
104
103
private final ConfigurableStyle configurableStyle = new ConfigurableStyle ();
105
104
106
- KtfmtConfig (String version ) {
105
+ private KtfmtConfig (String version ) {
107
106
Objects .requireNonNull (version );
108
107
this .version = Objects .requireNonNull (version );
109
108
addStep (createStep ());
110
109
}
111
110
112
- private ConfigurableStyle style (KtfmtStep .Style style ) {
113
- this .style = style ;
114
- replaceStep (createStep ());
115
- return configurableStyle ;
116
- }
117
-
118
111
public ConfigurableStyle dropboxStyle () {
119
112
return style (KtfmtStep .Style .DROPBOX );
120
113
}
@@ -131,13 +124,18 @@ public void configure(Consumer<KtfmtStep.KtfmtFormattingOptions> optionsConfigur
131
124
this .configurableStyle .configure (optionsConfiguration );
132
125
}
133
126
127
+ private ConfigurableStyle style (KtfmtStep .Style style ) {
128
+ this .style = style ;
129
+ replaceStep (createStep ());
130
+ return configurableStyle ;
131
+ }
132
+
134
133
private FormatterStep createStep () {
135
134
return KtfmtStep .create (version , provisioner (), style , options );
136
135
}
137
136
138
137
public class ConfigurableStyle {
139
-
140
- public void configure (Consumer <KtfmtStep .KtfmtFormattingOptions > optionsConfiguration ) {
138
+ private void configure (Consumer <KtfmtStep .KtfmtFormattingOptions > optionsConfiguration ) {
141
139
KtfmtStep .KtfmtFormattingOptions ktfmtFormattingOptions = new KtfmtStep .KtfmtFormattingOptions ();
142
140
optionsConfiguration .accept (ktfmtFormattingOptions );
143
141
options = ktfmtFormattingOptions ;
@@ -147,26 +145,27 @@ public void configure(Consumer<KtfmtStep.KtfmtFormattingOptions> optionsConfigur
147
145
}
148
146
149
147
public class KtlintConfig {
150
-
151
148
private final String version ;
152
149
@ Nullable
153
150
private FileSignature editorConfigPath ;
154
151
private Map <String , String > userData ;
155
152
private Map <String , Object > editorConfigOverride ;
156
153
157
- KtlintConfig (String version , Map <String , String > config ,
154
+ private KtlintConfig (
155
+ String version ,
156
+ Map <String , String > userData ,
158
157
Map <String , Object > editorConfigOverride ) throws IOException {
159
158
Objects .requireNonNull (version );
160
159
File defaultEditorConfig = getProject ().getRootProject ().file (".editorconfig" );
161
160
FileSignature editorConfigPath = defaultEditorConfig .exists () ? FileSignature .signAsList (defaultEditorConfig ) : null ;
162
161
this .version = version ;
163
162
this .editorConfigPath = editorConfigPath ;
164
- this .userData = config ;
163
+ this .userData = userData ;
165
164
this .editorConfigOverride = editorConfigOverride ;
166
165
addStep (createStep ());
167
166
}
168
167
169
- public KtlintConfig setEditorConfigPath (Object editorConfigPath ) throws IOException {
168
+ public KtlintConfig setEditorConfigPath (@ Nullable Object editorConfigPath ) throws IOException {
170
169
if (editorConfigPath == null ) {
171
170
this .editorConfigPath = null ;
172
171
} else {
0 commit comments