Skip to content

Commit

Permalink
Replace Detekt with Ktfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickmichalik committed Nov 30, 2023
1 parent 094e1d6 commit b72630e
Show file tree
Hide file tree
Showing 229 changed files with 7,334 additions and 7,407 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Run Detekt
name: Run Ktfmt
on:
push:
pull_request:
jobs:
run-detekt:
run-ktfmt:
runs-on: ubuntu-latest
continue-on-error: true
steps:
Expand All @@ -13,4 +13,4 @@ jobs:
java-version: 17
distribution: zulu
- uses: gradle/gradle-build-action@v2
- run: ./gradlew detekt
- run: ./gradlew ktfmtCheck
71 changes: 0 additions & 71 deletions .idea/detekt-config.yml

This file was deleted.

10 changes: 0 additions & 10 deletions .idea/detekt.xml

This file was deleted.

25 changes: 0 additions & 25 deletions .idea/jsonSchemas.xml

This file was deleted.

19 changes: 5 additions & 14 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

import io.gitlab.arturbosch.detekt.Detekt
import com.ncorti.ktfmt.gradle.KtfmtPlugin

buildscript {
dependencies {
Expand All @@ -25,24 +25,15 @@ buildscript {
}

plugins {
alias(libs.plugins.detekt)
alias(libs.plugins.dokka) apply false
alias(libs.plugins.ktfmt)
}

apply("versions.gradle")

dependencies { detektPlugins(libs.detektFormatting) }

tasks.register<Delete>("clean") { delete(rootProject.layout.buildDirectory) }

tasks.register<Detekt>("detektFix") { autoCorrect = true }

tasks.withType<Detekt>().configureEach {
source = fileTree(projectDir)
config = files(".idea/detekt-config.yml")
buildUponDefaultConfig = true
reports.html {
required = true
outputLocation = file("build/reports/detekt/detekt.html")
}
subprojects {
apply<KtfmtPlugin>()
ktfmt { kotlinLangStyle() }
}
5 changes: 2 additions & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ appcompat = "1.6.1"
composeBom = "2023.10.01"
composeCompiler = "1.5.4"
coroutines = "1.7.3"
detekt = "1.23.3"
dokka = "1.9.10"
jUnit = "4.13.2"
jUnitExt = "1.1.5"
kotlin = "1.9.20"
ktfmt = "0.15.1"
lifecycle = "2.6.2"
material = "1.10.0"
mockK = "1.13.7"
Expand All @@ -33,7 +33,6 @@ composeUI = { group = "androidx.compose.ui", name = "ui" }
composeUITooling = { group = "androidx.compose.ui", name = "ui-tooling" }
composeViewBinding = { group = "androidx.compose.ui", name = "ui-viewbinding" }
coroutinesCore = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-core", version.ref = "coroutines" }
detektFormatting = { group = "io.gitlab.arturbosch.detekt", name = "detekt-formatting", version.ref = "detekt" }
jUnit = { group = "junit", name = "junit", version.ref = "jUnit" }
jUnitExt = { group = "androidx.test.ext", name = "junit", version.ref = "jUnitExt" }
kotlinGradlePlugin = { group = "org.jetbrains.kotlin", name = "kotlin-gradle-plugin", version.ref = "kotlin" }
Expand All @@ -48,5 +47,5 @@ testCore = { group = "androidx.test", name = "core-ktx", version.ref = "testCore
viewModelCompose = { group = "androidx.lifecycle", name = "lifecycle-viewmodel-compose", version.ref = "lifecycle" }

[plugins]
detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" }
dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" }
ktfmt = { id = "com.ncorti.ktfmt.gradle", version.ref = "ktfmt" }
11 changes: 6 additions & 5 deletions sample/src/main/java/com/patrykandpatrick/vico/sample/VicoApp.kt
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,15 @@ internal fun VicoApp() {
systemUiController.setSystemBarsColor(
color = Color.Transparent,
darkIcons = useDarkIcons,
isNavigationBarContrastEnforced = false,
isNavigationBarContrastEnforced = false
)
}
VicoTheme {
Box(
modifier = Modifier
.fillMaxSize()
.background(color = MaterialTheme.colorScheme.background),
) { ShowcaseScreen() }
modifier =
Modifier.fillMaxSize().background(color = MaterialTheme.colorScheme.background)
) {
ShowcaseScreen()
}
}
}
Loading

0 comments on commit b72630e

Please sign in to comment.