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

Fix ValShouldBeVar false positive inside unknown type #4820

Merged
merged 2 commits into from May 9, 2022

Conversation

themkat
Copy link
Contributor

@themkat themkat commented May 7, 2022

Attempt at fixing false positives for ValShouldBeVar when the assignment is inside an unknown type. This is the only logical solution I can think of at the moment. It basically assumes that if we can't resolve the type of the assignment, then it is from the inside of an unknown context (like a with-statement). Let me know if there is something I'm missing, and we can close/reject this PR...

Fixes #4736

@github-actions github-actions bot added the rules label May 7, 2022
@codecov
Copy link

codecov bot commented May 7, 2022

Codecov Report

Merging #4820 (62f7683) into main (faa985d) will increase coverage by 0.03%.
The diff coverage is 50.00%.

@@             Coverage Diff              @@
##               main    #4820      +/-   ##
============================================
+ Coverage     84.71%   84.74%   +0.03%     
  Complexity     3431     3431              
============================================
  Files           491      491              
  Lines         11267    11270       +3     
  Branches       2075     2074       -1     
============================================
+ Hits           9545     9551       +6     
  Misses          673      673              
+ Partials       1049     1046       -3     
Impacted Files Coverage Δ
...lab/arturbosch/detekt/rules/style/VarCouldBeVal.kt 81.55% <50.00%> (+1.16%) ⬆️
...turbosch/detekt/rules/complexity/NamedArguments.kt 83.33% <0.00%> (+1.19%) ⬆️
...lab/arturbosch/detekt/rules/style/UnusedImports.kt 89.87% <0.00%> (+2.53%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update faa985d...62f7683. Read the comment docs.

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: VarCouldBeVal
3 participants