File tree Expand file tree Collapse file tree 4 files changed +28
-7
lines changed
main/java/com/diffplug/gradle/spotless
test/java/com/diffplug/gradle/spotless
testlib/src/main/resources/kotlin/ktfmt Expand file tree Collapse file tree 4 files changed +28
-7
lines changed Original file line number Diff line number Diff line change 3
3
We adhere to the [ keepachangelog] ( https://keepachangelog.com/en/1.0.0/ ) format (starting after version ` 3.27.0 ` ).
4
4
5
5
## [ Unreleased]
6
+ ### Fixed
7
+ * Make ` KtfmtConfig.ConfigurableStyle#configure ` public. ([ #1926 ] ( https://github.com/diffplug/spotless/pull/1926 ) )
6
8
7
9
## [ 6.23.2] - 2023-12-01
8
10
### Fixed
Original file line number Diff line number Diff line change @@ -136,7 +136,7 @@ private FormatterStep createStep() {
136
136
}
137
137
138
138
public class ConfigurableStyle {
139
- private void configure (Consumer <KtfmtStep .KtfmtFormattingOptions > optionsConfiguration ) {
139
+ public void configure (Consumer <KtfmtStep .KtfmtFormattingOptions > optionsConfiguration ) {
140
140
KtfmtStep .KtfmtFormattingOptions ktfmtFormattingOptions = new KtfmtStep .KtfmtFormattingOptions ();
141
141
optionsConfiguration .accept (ktfmtFormattingOptions );
142
142
options = ktfmtFormattingOptions ;
Original file line number Diff line number Diff line change @@ -45,21 +45,26 @@ void integrationDiktat() throws IOException {
45
45
}
46
46
47
47
@ Test
48
- void integrationKtfmt_dropboxStyle_0_19 () throws IOException {
49
- setFile ("build.gradle" ).toLines (
48
+ void integrationKtfmtDropboxStyleWithPublicApi () throws IOException {
49
+ setFile ("build.gradle.kts " ).toLines (
50
50
"plugins {" ,
51
- " id ' org.jetbrains.kotlin.jvm' version ' 1.6.21' " ,
52
- " id ' com.diffplug.spotless' " ,
51
+ " id( \" org.jetbrains.kotlin.jvm\" ) version \" 1.6.21\" " ,
52
+ " id( \" com.diffplug.spotless\" ) " ,
53
53
"}" ,
54
54
"repositories { mavenCentral() }" ,
55
55
"spotless {" ,
56
56
" kotlin {" ,
57
- " ktfmt('0.19').dropboxStyle()" ,
57
+ " ktfmt().dropboxStyle().configure {" ,
58
+ " it.setMaxWidth(4)" ,
59
+ " it.setBlockIndent(4)" ,
60
+ " it.setContinuationIndent(4)" ,
61
+ " it.setRemoveUnusedImport(false)" ,
62
+ " }" ,
58
63
" }" ,
59
64
"}" );
60
65
setFile ("src/main/kotlin/basic.kt" ).toResource ("kotlin/ktfmt/basic.dirty" );
61
66
gradleRunner ().withArguments ("spotlessApply" ).build ();
62
- assertFile ("src/main/kotlin/basic.kt" ).sameAsResource ("kotlin/ktfmt/basic-dropboxstyle .clean" );
67
+ assertFile ("src/main/kotlin/basic.kt" ).sameAsResource ("kotlin/ktfmt/basic-dropbox-style .clean" );
63
68
}
64
69
65
70
@ Test
Original file line number Diff line number Diff line change
1
+ import a.*
2
+ import a.b
3
+ import a.b.c.*
4
+ import kotlinx.android.synthetic.main.layout_name.*
5
+
6
+ fun main() {
7
+ fun name() {
8
+ a()
9
+ return b
10
+ }
11
+ println(
12
+ ";")
13
+ println()
14
+ }
You can’t perform that action at this time.
0 commit comments