Skip to content

Commit

Permalink
Detekt cleanup (#151)
Browse files Browse the repository at this point in the history
* Detekt cleanup

* add detekt to CI, remove Lint
  • Loading branch information
RBusarow committed Jul 17, 2020
1 parent f653d81 commit cd1bc64
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 72 deletions.
15 changes: 2 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,5 @@ jobs:
java-version: 1.8
- name: all tests
run: ./gradlew test

lint:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: lint
run: ./gradlew lint
- name: detekt
run: ./gradlew detekt
78 changes: 19 additions & 59 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -258,73 +258,33 @@ val copyRootFiles by tasks.registering {
}
}

subprojects {

apply {
plugin("io.gitlab.arturbosch.detekt")
}

detekt {
parallel = true
config = files("$rootDir/detekt/detekt-config.yml")
detekt {
parallel = true
config = files("$rootDir/detekt/detekt-config.yml")

val unique = "${rootProject.relativePath(projectDir)}/${project.name}"
val unique = "${rootProject.relativePath(projectDir)}/${project.name}"

reports {
xml {
enabled = false
destination = file("$rootDir/build/detekt-reports/$unique-detekt.xml")
}
html {
enabled = true
destination = file("$rootDir/build/detekt-reports/$unique-detekt.html")
}
txt {
enabled = false
destination = file("$rootDir/build/detekt-reports/$unique-detekt.txt")
}
reports {
xml {
enabled = false
destination = file("$rootDir/build/detekt-reports/$unique-detekt.xml")
}
html {
enabled = true
destination = file("$rootDir/build/detekt-reports/$unique-detekt.html")
}
txt {
enabled = false
destination = file("$rootDir/build/detekt-reports/$unique-detekt.txt")
}
}
}

allprojects {
dependencies {
detekt(Libs.Detekt.cli)
detektPlugins(project(path = ":dispatch-detekt"))
}
}

val analysisDir = file(projectDir)
val baselineFile = file("$rootDir/detekt/project-baseline.xml")
val configFile = file("$rootDir/detekt/detekt-config.yml")
val formatConfigFile = file("$rootDir/config/detekt/format.yml")
val statisticsConfigFile = file("$rootDir/config/detekt/statistics.yml")

val kotlinFiles = "**/*.kt"
val kotlinScriptFiles = "**/*.kts"
val resourceFiles = "**/resources/**"
val buildFiles = "**/build/**"
val testFiles = "**/src/test/**"

val detektAll by tasks.registering(Detekt::class) {

description = "Runs the whole project at once."
parallel = true
buildUponDefaultConfig = true
setSource(files(rootDir))
config.setFrom(files(configFile))
include(kotlinFiles, kotlinScriptFiles)
exclude(resourceFiles, buildFiles, testFiles)
reports {
xml.enabled = false
html.enabled = false
txt.enabled = false
}
dependencies {
detekt(Libs.Detekt.cli)
detektPlugins(project(path = ":dispatch-detekt"))
}

tasks.findByName("detekt")
?.finalizedBy(detektAll)

apply(plugin = Plugins.binaryCompatilibity)

extensions.configure<ApiValidationExtension> {
Expand Down

0 comments on commit cd1bc64

Please sign in to comment.