Skip to content

Commit

Permalink
Make KtfmtConfig.ConfigurableStyle#configure public
Browse files Browse the repository at this point in the history
  • Loading branch information
Goooler committed Dec 2, 2023
1 parent 28e948e commit 78c347c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
2 changes: 2 additions & 0 deletions plugin-gradle/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (starting after version `3.27.0`).

## [Unreleased]
### Fixed
* Make `KtfmtConfig.ConfigurableStyle#configure` public. ([#1926](https://github.com/diffplug/spotless/pull/1926))

## [6.23.2] - 2023-12-01
### Fixed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ private FormatterStep createStep() {
}

public class ConfigurableStyle {
private void configure(Consumer<KtfmtStep.KtfmtFormattingOptions> optionsConfiguration) {
public void configure(Consumer<KtfmtStep.KtfmtFormattingOptions> optionsConfiguration) {
KtfmtStep.KtfmtFormattingOptions ktfmtFormattingOptions = new KtfmtStep.KtfmtFormattingOptions();
optionsConfiguration.accept(ktfmtFormattingOptions);
options = ktfmtFormattingOptions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,21 @@ void integrationDiktat() throws IOException {
}

@Test
void integrationKtfmt_dropboxStyle_0_19() throws IOException {
setFile("build.gradle").toLines(
void integrationKtfmtDropboxStyleWithPublicApi() throws IOException {
setFile("build.gradle.kts").toLines(
"plugins {",
" id 'org.jetbrains.kotlin.jvm' version '1.6.21'",
" id 'com.diffplug.spotless'",
" id(\"org.jetbrains.kotlin.jvm\") version \"1.6.21\"",
" id(\"com.diffplug.spotless\")",
"}",
"repositories { mavenCentral() }",
"spotless {",
" kotlin {",
" ktfmt('0.19').dropboxStyle()",
" ktfmt().dropboxStyle().configure {",
" it.setMaxWidth(4)",
" it.setBlockIndent(4)",
" it.setContinuationIndent(4)",
" it.setRemoveUnusedImport(false)",
" }",
" }",
"}");
setFile("src/main/kotlin/basic.kt").toResource("kotlin/ktfmt/basic.dirty");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ fun main() {
a()
return b
}
println(";")
println(
";")
println()
}

0 comments on commit 78c347c

Please sign in to comment.