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

VarCouldBeVal: don't report assigned property that is defined in anonymous object #3880

Merged
merged 3 commits into from
Jun 20, 2021

Conversation

t-kameyama
Copy link
Contributor

Fixes #3805

@codecov
Copy link

codecov bot commented Jun 17, 2021

Codecov Report

Merging #3880 (170973a) into main (158744f) will increase coverage by 0.01%.
The diff coverage is 78.94%.

Impacted file tree graph

@@             Coverage Diff              @@
##               main    #3880      +/-   ##
============================================
+ Coverage     83.50%   83.51%   +0.01%     
- Complexity     3115     3118       +3     
============================================
  Files           456      456              
  Lines          9001     8992       -9     
  Branches       1757     1752       -5     
============================================
- Hits           7516     7510       -6     
  Misses          566      566              
+ Partials        919      916       -3     
Impacted Files Coverage Δ
...lab/arturbosch/detekt/rules/style/VarCouldBeVal.kt 87.80% <78.94%> (+3.49%) ⬆️
...bosch/detekt/rules/complexity/LongParameterList.kt 89.79% <0.00%> (+0.21%) ⬆️

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 158744f...170973a. Read the comment docs.

@@ -41,6 +43,7 @@ private val unaryAssignmentOperators = setOf(KtTokens.MINUSMINUS, KtTokens.PLUSP
* </compliant>
*/
@ActiveByDefault(since = "1.16.0")
@RequiresTypeResolution
Copy link
Member

Choose a reason for hiding this comment

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

It seems quite unfortunate that we are now converting plain rules to type resolving rules like such.

I think this PR should still be good to go, but I would want to highlight this for us to favor detekt compiler plugin.

Copy link
Member

Choose a reason for hiding this comment

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

I believe we could mention this in the release notes but we're good to go imho.

@cortinico cortinico added this to the 1.18.0 milestone Jun 19, 2021
@cortinico cortinico added the notable changes Marker for notable changes in the changelog label Jun 19, 2021
Copy link
Member

@cortinico cortinico left a comment

Choose a reason for hiding this comment

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

Great work, thanks for fixing this 🙏

}
}
}

describe("properties defined in anonymous object - #3805") {
Copy link
Member

Choose a reason for hiding this comment

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

Would you be able to add a test case also for:
#3805 (comment)

@t-kameyama t-kameyama requested a review from cortinico June 20, 2021 00:05
@cortinico cortinico merged commit f4f41f9 into detekt:main Jun 20, 2021
@t-kameyama t-kameyama deleted the issue_3805 branch June 20, 2021 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
notable changes Marker for notable changes in the changelog rules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrong VarCouldBeVal report
5 participants