Skip to content

Remove Spek support from detekt-test-utils #5785

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

Merged
merged 1 commit into from
Feb 17, 2023
Merged

Conversation

3flex
Copy link
Member

@3flex 3flex commented Feb 12, 2023

It's been about 10 months since v1.20.0 was released and we deprecated Spek support. I think it's time to drop it completely.

For future readers, if you want to continue using the support that was provided by detekt, just use:

fun Root.setupKotlinEnvironment(additionalJavaSourceRootPath: Path? = null) {
    val wrapper by memoized(
        CachingMode.SCOPE,
        { createEnvironment(additionalJavaSourceRootPaths = listOfNotNull(additionalJavaSourceRootPath?.toFile())) },
        { it.dispose() }
    )

    // name is used for delegation
    @Suppress("UNUSED_VARIABLE")
    val env: KotlinCoreEnvironment by memoized(CachingMode.EACH_GROUP) { wrapper.env }
}

You'll need to tweak your imports but otherwise this should continue working for the foreseeable future.

@github-actions github-actions bot added api build dependencies Pull requests that update a dependency file documentation labels Feb 12, 2023
@3flex 3flex added this to the 1.23.0 milestone Feb 12, 2023
@github-actions
Copy link

Messages
📖

Thank you very much for making our website better ❤️!

Generated by 🚫 dangerJS against 38f128c

@codecov
Copy link

codecov bot commented Feb 12, 2023

Codecov Report

Merging #5785 (38f128c) into main (5d45cba) will increase coverage by 0.05%.
The diff coverage is n/a.

@@             Coverage Diff              @@
##               main    #5785      +/-   ##
============================================
+ Coverage     84.48%   84.53%   +0.05%     
  Complexity     3743     3743              
============================================
  Files           546      546              
  Lines         12788    12780       -8     
  Branches       2230     2229       -1     
============================================
  Hits          10804    10804              
+ Misses          869      861       -8     
  Partials       1115     1115              
Impacted Files Coverage Δ
...urbosch/detekt/rules/KotlinEnvironmentTestSetup.kt 75.00% <ø> (+21.42%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Member

@schalkms schalkms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good one!

@schalkms schalkms merged commit 91d1511 into detekt:main Feb 17, 2023
@3flex 3flex deleted the drop-spek branch February 17, 2023 22:45
@cortinico cortinico added the notable changes Marker for notable changes in the changelog label Feb 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api build dependencies Pull requests that update a dependency file documentation notable changes Marker for notable changes in the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants