Loading .github/pull_request_template.md +1 −1 Original line number Diff line number Diff line Loading @@ -3,7 +3,7 @@ Please ensure that your pull request meets the following requirements - thanks! - Does not contain merge commits. Rebase instead. - Contains commits with descriptive titles. - New code is written in Kotlin whenever possible. - Follows our existing codestyle (`gradlew spotlessCheck` to check and `gradlew spotlessFormat` to format your source code; will be checked by CI). - Follows our existing codestyle (`gradlew spotlessCheck` to check and `gradlew spotlessApply` to format your source code; will be checked by CI). - Does not break any unit tests (`gradlew testDebugUnitTest`; will be checked by CI). - Uses a descriptive title; don't put issue numbers in there. - Contains a reference to the issue that it fixes (e.g. _Closes #XXX_ or _Fixes #XXX_) in the body text. Loading build-plugin/src/main/kotlin/SpotlessExtension.kt 0 → 100644 +67 −0 Original line number Diff line number Diff line import com.diffplug.gradle.spotless.SpotlessExtension import org.gradle.accessors.dm.LibrariesForLibs import org.gradle.api.Project fun SpotlessExtension.configureKotlinCheck( targets: List<String>, project: Project, libs: LibrariesForLibs, ) { kotlin { ktlint(libs.versions.ktlint.get()) .setEditorConfigPath("${project.rootProject.projectDir}/.editorconfig") .editorConfigOverride(kotlinEditorConfigOverride) target(targets) targetExclude( "**/build/", ) } } fun SpotlessExtension.configureKotlinGradleCheck( targets: List<String>, project: Project, libs: LibrariesForLibs, ) { kotlinGradle { ktlint(libs.versions.ktlint.get()) .setEditorConfigPath("${project.rootProject.projectDir}/.editorconfig") .editorConfigOverride( mapOf( "ktlint_standard_function-signature" to "disabled", ) ) target(targets) targetExclude("**/build/") } } fun SpotlessExtension.configureMarkdownCheck( targets: List<String>, ) { format("markdown") { prettier() target(targets) targetExclude( "**/build/", ) } } fun SpotlessExtension.configureMiscCheck() { format("misc") { target( "*.gradle", ".gitignore", ) trimTrailingWhitespace() } } val kotlinEditorConfigOverride = mapOf( "ktlint_function_naming_ignore_when_annotated_with" to "Composable", "ktlint_standard_property-naming" to "disabled", "ktlint_standard_function-signature" to "disabled", "ktlint_standard_parameter-list-spacing" to "disabled", "ktlint_ignore_back_ticked_identifier" to "true", ) build-plugin/src/main/kotlin/thunderbird.app.android.compose.gradle.kts +1 −0 Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ plugins { id("thunderbird.app.android") id("org.jetbrains.kotlin.plugin.compose") id("thunderbird.quality.detekt.typed") id("thunderbird.quality.spotless") } android { Loading build-plugin/src/main/kotlin/thunderbird.app.android.gradle.kts +1 −0 Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ plugins { id("com.android.application") id("org.jetbrains.kotlin.android") id("thunderbird.quality.detekt.typed") id("thunderbird.quality.spotless") } android { Loading build-plugin/src/main/kotlin/thunderbird.app.jvm.gradle.kts +1 −0 Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ plugins { id("application") id("org.jetbrains.kotlin.jvm") id("thunderbird.quality.detekt.typed") id("thunderbird.quality.spotless") } java { Loading Loading
.github/pull_request_template.md +1 −1 Original line number Diff line number Diff line Loading @@ -3,7 +3,7 @@ Please ensure that your pull request meets the following requirements - thanks! - Does not contain merge commits. Rebase instead. - Contains commits with descriptive titles. - New code is written in Kotlin whenever possible. - Follows our existing codestyle (`gradlew spotlessCheck` to check and `gradlew spotlessFormat` to format your source code; will be checked by CI). - Follows our existing codestyle (`gradlew spotlessCheck` to check and `gradlew spotlessApply` to format your source code; will be checked by CI). - Does not break any unit tests (`gradlew testDebugUnitTest`; will be checked by CI). - Uses a descriptive title; don't put issue numbers in there. - Contains a reference to the issue that it fixes (e.g. _Closes #XXX_ or _Fixes #XXX_) in the body text. Loading
build-plugin/src/main/kotlin/SpotlessExtension.kt 0 → 100644 +67 −0 Original line number Diff line number Diff line import com.diffplug.gradle.spotless.SpotlessExtension import org.gradle.accessors.dm.LibrariesForLibs import org.gradle.api.Project fun SpotlessExtension.configureKotlinCheck( targets: List<String>, project: Project, libs: LibrariesForLibs, ) { kotlin { ktlint(libs.versions.ktlint.get()) .setEditorConfigPath("${project.rootProject.projectDir}/.editorconfig") .editorConfigOverride(kotlinEditorConfigOverride) target(targets) targetExclude( "**/build/", ) } } fun SpotlessExtension.configureKotlinGradleCheck( targets: List<String>, project: Project, libs: LibrariesForLibs, ) { kotlinGradle { ktlint(libs.versions.ktlint.get()) .setEditorConfigPath("${project.rootProject.projectDir}/.editorconfig") .editorConfigOverride( mapOf( "ktlint_standard_function-signature" to "disabled", ) ) target(targets) targetExclude("**/build/") } } fun SpotlessExtension.configureMarkdownCheck( targets: List<String>, ) { format("markdown") { prettier() target(targets) targetExclude( "**/build/", ) } } fun SpotlessExtension.configureMiscCheck() { format("misc") { target( "*.gradle", ".gitignore", ) trimTrailingWhitespace() } } val kotlinEditorConfigOverride = mapOf( "ktlint_function_naming_ignore_when_annotated_with" to "Composable", "ktlint_standard_property-naming" to "disabled", "ktlint_standard_function-signature" to "disabled", "ktlint_standard_parameter-list-spacing" to "disabled", "ktlint_ignore_back_ticked_identifier" to "true", )
build-plugin/src/main/kotlin/thunderbird.app.android.compose.gradle.kts +1 −0 Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ plugins { id("thunderbird.app.android") id("org.jetbrains.kotlin.plugin.compose") id("thunderbird.quality.detekt.typed") id("thunderbird.quality.spotless") } android { Loading
build-plugin/src/main/kotlin/thunderbird.app.android.gradle.kts +1 −0 Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ plugins { id("com.android.application") id("org.jetbrains.kotlin.android") id("thunderbird.quality.detekt.typed") id("thunderbird.quality.spotless") } android { Loading
build-plugin/src/main/kotlin/thunderbird.app.jvm.gradle.kts +1 −0 Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ plugins { id("application") id("org.jetbrains.kotlin.jvm") id("thunderbird.quality.detekt.typed") id("thunderbird.quality.spotless") } java { Loading