Skip to content

Commit

Permalink
#394 Move mapping of formatter options to KtfmtWorker, so that it is …
Browse files Browse the repository at this point in the history
…the only class accessing ktfmt directly
  • Loading branch information
simonhauck committed Jan 17, 2025
1 parent e6187d2 commit 33eacf1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 44 deletions.
4 changes: 0 additions & 4 deletions plugin-build/plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,6 @@ dependencies {
testImplementation(platform(libs.junit.bom))
testImplementation(libs.jupiter)
testImplementation(libs.truth)

testImplementation(libs.ktfmt){
isTransitive = false
}
}

@Suppress("UnstableApiUsage")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,14 @@ internal abstract class KtfmtWorkAction : WorkAction<KtfmtWorkAction.KtfmtWorkPa

return sourceFile.canonicalFile !in includedFiles
}
}

internal fun FormattingOptionsBean.toFormattingOptions(): FormattingOptions =
FormattingOptions(
maxWidth = maxWidth,
blockIndent = blockIndent,
continuationIndent = continuationIndent,
removeUnusedImports = removeUnusedImports,
manageTrailingCommas = manageTrailingCommas,
debuggingPrintOpsAfterFormatting = debuggingPrintOpsAfterFormatting,
)
private fun FormattingOptionsBean.toFormattingOptions(): FormattingOptions =
FormattingOptions(
maxWidth = maxWidth,
blockIndent = blockIndent,
continuationIndent = continuationIndent,
removeUnusedImports = removeUnusedImports,
manageTrailingCommas = manageTrailingCommas,
debuggingPrintOpsAfterFormatting = debuggingPrintOpsAfterFormatting,
)
}

This file was deleted.

0 comments on commit 33eacf1

Please sign in to comment.