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

Check Thread.sleep for block expression #5699

Merged
merged 2 commits into from Feb 26, 2023
Merged

Conversation

atulgpt
Copy link
Contributor

@atulgpt atulgpt commented Jan 15, 2023

Fixes #5659
Add check of canGoInside when lambda argument is suspend

Copy link
Member

@BraisGabin BraisGabin 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! 👏👏👏 Thanks :)

@BraisGabin
Copy link
Member

@atulgpt could you check CI? It seems that the snippets doesn't compile. Once that's fixed this is ready to merge.

Add check of canGoInside when lambda argument is suspend
@github-actions
Copy link

github-actions bot commented Feb 25, 2023

Warnings
⚠️ This PR is approved with no milestone set. If merged, it won't appear in the Detekt release notes.

Generated by 🚫 dangerJS against 53fbb90

@atulgpt
Copy link
Contributor Author

atulgpt commented Feb 25, 2023

Hi @BraisGabin, updated the PR(also reworked the traversal logic as in the previous logic some newly added TCs were failing)

@cortinico at the comment #5666 (comment) I told about there are some bugs in coroutine related rule(some not honoring suspend operator and some not handling inline and other types of lambda). In this rule, there was not any possibility of suspend operator error but this had a few issues with handling inline, noinline and crossinline modifiers which I fixed with this PR

@codecov
Copy link

codecov bot commented Feb 25, 2023

Codecov Report

Merging #5699 (53fbb90) into main (cb6a705) will decrease coverage by 0.03%.
The diff coverage is 70.73%.

@@             Coverage Diff              @@
##               main    #5699      +/-   ##
============================================
- Coverage     84.59%   84.57%   -0.03%     
+ Complexity     3790     3786       -4     
============================================
  Files           546      546              
  Lines         12918    12937      +19     
  Branches       2268     2273       +5     
============================================
+ Hits          10928    10941      +13     
- Misses          861      863       +2     
- Partials       1129     1133       +4     
Impacted Files Coverage Δ
...sch/detekt/rules/coroutines/SleepInsteadOfDelay.kt 74.00% <70.73%> (-1.87%) ⬇️
.../detekt/rules/naming/ConstructorParameterNaming.kt 88.57% <0.00%> (-0.32%) ⬇️
...bosch/detekt/rules/naming/BooleanPropertyNaming.kt 94.11% <0.00%> (-0.17%) ⬇️
...b/arturbosch/detekt/rules/naming/FunctionNaming.kt 100.00% <0.00%> (ø)
...b/arturbosch/detekt/rules/naming/VariableNaming.kt 88.57% <0.00%> (ø)
...sch/detekt/rules/naming/FunctionParameterNaming.kt 89.28% <0.00%> (ø)

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

Add more TCs around which failed in previous implementation
@atulgpt
Copy link
Contributor Author

atulgpt commented Feb 25, 2023

Hi @BraisGabin , some intermittent error in CI can you retrigger?

@BraisGabin BraisGabin added this to the 1.23.0 milestone Feb 26, 2023
@BraisGabin BraisGabin merged commit 2ae921a into detekt:main Feb 26, 2023
@atulgpt atulgpt deleted the fixes-5659 branch February 26, 2023 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

False positive in the SleepInsteadOfDelay rule
2 participants