Skip to content

Commit

Permalink
ci: Fix checkers calls
Browse files Browse the repository at this point in the history
  • Loading branch information
bartwell committed Nov 16, 2022
1 parent 860d00e commit d1e8a62
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 30 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci_review_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ jobs:
run: ./gradlew clean assembleDebug

- name: Run Lint
run: ./gradlew mewwalletui:lintDebug
run: ./gradlew lintDebug

- name: Run Detekt
run: ./gradlew detektDebug
run: ./gradlew detektAll

- name: Run Danger
run: |
Expand Down
58 changes: 30 additions & 28 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,36 +12,38 @@ plugins {
id 'io.gitlab.arturbosch.detekt' version '1.21.0' apply false
}

def projectSource = file(projectDir)
def configFile = files("$rootDir/config/detekt/detekt.yml")
def baselineFile = file("$rootDir/config/detekt/baseline.xml")
def kotlinFiles = "**/*.kt"
def resourceFiles = "**/resources/**"
def buildFiles = "**/build/**"
allprojects {
def projectSource = file(projectDir)
def configFile = files("$rootDir/config/detekt/detekt.yml")
def baselineFile = file("$rootDir/config/detekt/baseline.xml")
def kotlinFiles = "**/*.kt"
def resourceFiles = "**/resources/**"
def buildFiles = "**/build/**"

apply plugin: 'io.gitlab.arturbosch.detekt'
apply plugin: 'io.gitlab.arturbosch.detekt'

tasks.register("detektAll", Detekt) {
def autoFix = project.hasProperty('detektAutoFix')
description = "Detekt build for all modules"
parallel = false
ignoreFailures = true
autoCorrect = autoFix
buildUponDefaultConfig = true
setSource(projectSource)
baseline.set(baselineFile)
config.setFrom(configFile)
include(kotlinFiles)
exclude(resourceFiles, buildFiles)
reports {
html.enabled = true
xml.enabled = false
txt.enabled = false
tasks.register("detektAll", Detekt) {
def autoFix = project.hasProperty('detektAutoFix')
description = "Detekt build for all modules"
parallel = false
ignoreFailures = true
autoCorrect = autoFix
buildUponDefaultConfig = true
setSource(projectSource)
baseline.set(baselineFile)
config.setFrom(configFile)
include(kotlinFiles)
exclude(resourceFiles, buildFiles)
reports {
html.enabled = false
xml.enabled = true
txt.enabled = false
}
}
}

dependencies {
detektPlugins "io.gitlab.arturbosch.detekt:detekt-formatting:1.21.0"
detektPlugins("ru.kode:detekt-rules-compose:1.2.2")
detektPlugins "io.gitlab.arturbosch.detekt:detekt-formatting:1.21.0"
dependencies {
detektPlugins "io.gitlab.arturbosch.detekt:detekt-formatting:1.21.0"
detektPlugins("ru.kode:detekt-rules-compose:1.2.2")
detektPlugins "io.gitlab.arturbosch.detekt:detekt-formatting:1.21.0"
}
}
7 changes: 7 additions & 0 deletions sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ android {
composeOptions {
kotlinCompilerExtensionVersion compose_version
}
lint {
warningsAsErrors true
abortOnError false
checkDependencies true
baseline file("$rootDir/config/lint/lint-baseline.xml")
lintConfig file("$rootDir/config/lint/lint.xml")
}
packagingOptions {
resources {
excludes += '/META-INF/{AL2.0,LGPL2.1}'
Expand Down

0 comments on commit d1e8a62

Please sign in to comment.