Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detekt cleanup #151

Merged
merged 2 commits into from
Jul 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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