Skip to content

Commit

Permalink
Update detekt's baseline & run detekt for future build (#1106)
Browse files Browse the repository at this point in the history
* Update detekt baseline from mihon

* Update detekt baseline to current code & enable gradle's detekt task for future build
  • Loading branch information
cuong-tran authored Mar 16, 2024
1 parent a069e57 commit b7e55bc
Show file tree
Hide file tree
Showing 4 changed files with 1,160 additions and 190 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
uses: gradle/actions/setup-gradle@v3

- name: Build app
run: ./gradlew assembleDevDebug
run: ./gradlew detekt assembleDevDebug

- name: Upload APK
uses: actions/upload-artifact@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
# SY -->

- name: Build app and run unit tests
run: ./gradlew assembleStandardRelease testStandardReleaseUnitTest --stacktrace
run: ./gradlew detekt assembleStandardRelease testStandardReleaseUnitTest --stacktrace

- name: Sign APK
uses: r0adkll/sign-android-release@v1
Expand Down
12 changes: 12 additions & 0 deletions buildSrc/src/main/kotlin/detekt.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,18 @@ detekt {
baseline = file(baselineFile)
}

val detektProjectBaseline by tasks.registering(DetektCreateBaselineTask::class) {
description = "Overrides current baseline."
buildUponDefaultConfig.set(true)
ignoreFailures.set(true)
parallel.set(true)
setSource(files(rootDir))
config.setFrom(configFile)
baseline = file(baselineFile)
include(kotlinFiles)
exclude(resourceFiles, buildFiles, generatedFiles, scriptsFiles)
}

tasks.withType<Detekt>().configureEach {
include(kotlinFiles)
exclude(resourceFiles, buildFiles, generatedFiles, scriptsFiles)
Expand Down
Loading

0 comments on commit b7e55bc

Please sign in to comment.