-
-
Notifications
You must be signed in to change notification settings - Fork 784
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
Drop (most) Groovy DSL tests #4687
Conversation
Codecov Report
@@ Coverage Diff @@
## main #4687 +/- ##
=========================================
Coverage 84.44% 84.44%
Complexity 3436 3436
=========================================
Files 492 492
Lines 11337 11337
Branches 2083 2083
=========================================
Hits 9573 9573
Misses 703 703
Partials 1061 1061 Continue to review full report at Codecov.
|
""".trimMargin() | ||
) | ||
} | ||
val mainBuildFileContent: String = """ | ||
|plugins { | ||
| id "io.gitlab.arturbosch.detekt" apply false | ||
| id("io.gitlab.arturbosch.detekt") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the only behaviour change I had to introduce (here, and again in a later test in this class).
Because of the way Gradle generates type-safe accessors for extensions provided by plugins it's necessary to apply the plugin to the root project so that the detekt extension can be used later in the subprojects
block. This doesn't impact the behaviour of the test itself though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
detekt-gradle-plugin/src/test/kotlin/io/gitlab/arturbosch/detekt/DetektMultiplatformSpec.kt
Outdated
Show resolved
Hide resolved
detekt-gradle-plugin/src/test/kotlin/io/gitlab/arturbosch/detekt/DetektJvmSpec.kt
Outdated
Show resolved
Hide resolved
* Drop Groovy DSL-based tests where Kotlin DSL-based equivalent exists * Rewrite remaining Groovy DSL-based tests to use Kotlin DSL * Add dedicated Groovy DSL test * Use kotlin dependency extension where possible * Suppress LongMethod detekt warning
Closes #4560
There's a new Groovy DSL test in
DetektTaskGroovyDslSpec
which covers the entire DSL for the extension and the three detekt tasks. It doesn't run the task since many files etc. won't be accessible. Instead, the:help
task is run, which compiles the build files. Usingtasks.create
for these tasks means the tasks will be created & configured even though they're not run.