Skip to content

Commit

Permalink
Drop Spek (#4670)
Browse files Browse the repository at this point in the history
Co-authored-by: Goooler <wangzongler@gmail.com>
Co-authored-by: Nicola Corti <corti.nico@gmail.com>
  • Loading branch information
3 people committed Apr 11, 2022
1 parent d28d0af commit 8939aed
Show file tree
Hide file tree
Showing 17 changed files with 59 additions and 365 deletions.
5 changes: 2 additions & 3 deletions .github/CONTRIBUTING.md
Expand Up @@ -10,9 +10,8 @@
- We use [JUnit 5](https://junit.org/junit5/docs/current/user-guide/) for testing. Please use the `Spec.kt` suffix on
new test classes. If your new rule requires type resolution (i.e. it utilises `BindingContext`) then annotate your
test class with `@KotlinCoreEnvironmentTest` and have the test class accept `KotlinCoreEnvironment` as a parameter.
See `SpekTestDiscoverySpec.kt` in the `custom-checks` module for a complete example.
- We are in the process of migrating existing [Spek](https://github.com/spekframework/spek) tests to JUnit 5. For easier
testing of these tests you might want to use the [Spek IntelliJ Plugin](https://plugins.jetbrains.com/plugin/10915-spek-framework).
See "Testing a rule that uses type resolution" section of the [Using Type Resolution](../docs/pages/gettingstarted/type-resolution.md)
guide for details.
- Feel free to add your name to the contributors list at the end of the readme file when opening a pull request.
- The code in `detekt-api` and any rule in `detekt-rules` must be documented. We generate documentation for our website based on these modules.
- If some Kotlin code in `resources` folder (like `detekt-formatting`) shows a compilation error, right click on it and use `Mark as plain text`.
Expand Down
3 changes: 0 additions & 3 deletions build-logic/src/main/kotlin/module.gradle.kts
Expand Up @@ -26,9 +26,6 @@ tasks.withType<PublishToMavenRepository>().configureEach {

tasks.withType<Test>().configureEach {
useJUnitPlatform()
systemProperty("spek2.jvm.cg.scan.concurrency", 1) // use one thread for classpath scanning
systemProperty("spek2.execution.test.timeout", 0) // disable test timeout
systemProperty("spek2.discovery.parallel.enabled", 0) // disable parallel test discovery
systemProperty("junit.jupiter.testinstance.lifecycle.default", "per_class")
val compileSnippetText: Boolean = if (project.hasProperty("compile-test-snippets")) {
(project.property("compile-test-snippets") as String).toBoolean()
Expand Down
1 change: 0 additions & 1 deletion build.gradle.kts
Expand Up @@ -27,7 +27,6 @@ allprojects {

dependencies {
detekt(project(":detekt-cli"))
detektPlugins(project(":custom-checks"))
detektPlugins(project(":detekt-formatting"))
}

Expand Down
1 change: 0 additions & 1 deletion code-coverage-report/build.gradle.kts
Expand Up @@ -14,7 +14,6 @@ reporting {
jacoco.toolVersion = libs.versions.jacoco.get()

dependencies {
jacocoAggregation(projects.customChecks)
jacocoAggregation(projects.detektApi)
jacocoAggregation(projects.detektCli)
jacocoAggregation(projects.detektCore)
Expand Down
12 changes: 0 additions & 12 deletions config/detekt/detekt.yml
@@ -1,15 +1,3 @@
config:
# is automatically ignored when custom-checks.jar is on the classpath
# however other CI checks use the argsfile where our plugin is not applied
# we need to care take of this by explicitly allowing this properties
excludes: 'custom-checks.*'

custom-checks:
active: true
SpekTestDiscovery:
active: true
includes: ['**/test/**/*Spec.kt']

comments:
CommentOverPrivateProperty:
active: true
Expand Down
10 changes: 0 additions & 10 deletions custom-checks/build.gradle.kts

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Expand Up @@ -11,6 +11,10 @@ import org.spekframework.spek2.dsl.Root
import org.spekframework.spek2.lifecycle.CachingMode
import java.nio.file.Path

@Deprecated(
"This is specific to Spek and will be removed in a future release. Documentation has been updated to " +
"show alternative approaches: https://detekt.dev/type-resolution.html#testing-a-rule-that-uses-type-resolution"
)
fun Root.setupKotlinEnvironment(additionalJavaSourceRootPath: Path? = null) {
val wrapper by memoized(
CachingMode.SCOPE,
Expand Down

0 comments on commit 8939aed

Please sign in to comment.