From de6cdfee0e37aab03bfb91e5e90c3ec4bd740fe3 Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Tue, 28 May 2024 15:11:21 +0530 Subject: fix(build): automatically manage trailing commas in ktfmt --- .../kotlin/app/passwordstore/gradle/ktfmt/KtfmtWorkerAction.kt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'build-logic/src/main/kotlin/app') diff --git a/build-logic/src/main/kotlin/app/passwordstore/gradle/ktfmt/KtfmtWorkerAction.kt b/build-logic/src/main/kotlin/app/passwordstore/gradle/ktfmt/KtfmtWorkerAction.kt index d9b265b7..ef7e63e7 100644 --- a/build-logic/src/main/kotlin/app/passwordstore/gradle/ktfmt/KtfmtWorkerAction.kt +++ b/build-logic/src/main/kotlin/app/passwordstore/gradle/ktfmt/KtfmtWorkerAction.kt @@ -28,10 +28,14 @@ abstract class KtfmtWorkerAction : WorkAction { Formatter.format( FormattingOptions( style = FormattingOptions.Style.GOOGLE, - maxWidth = 100, + maxWidth = FormattingOptions.DEFAULT_MAX_WIDTH, + blockIndent = 2, continuationIndent = 2, + removeUnusedImports = true, + debuggingPrintOpsAfterFormatting = false, + manageTrailingCommas = true, ), - sourceText + sourceText, ) if (!formattedText.contentEquals(sourceText)) { -- cgit v1.2.3