Don't report UseDataClass if class contains non-property parameters - #6173
Merged
BraisGabin merged 2 commits intoJun 5, 2023
Merged
Conversation
Codecov Report
@@ Coverage Diff @@
## main #6173 +/- ##
============================================
- Coverage 84.45% 84.44% -0.02%
- Complexity 3994 3999 +5
============================================
Files 568 568
Lines 13428 13434 +6
Branches 2372 2377 +5
============================================
+ Hits 11341 11344 +3
Misses 935 935
- Partials 1152 1155 +3
|
schalkms
approved these changes
Jun 1, 2023
schalkms
left a comment
Member
There was a problem hiding this comment.
This looks good to me.
Thanks for picking this up!
BraisGabin
approved these changes
Jun 5, 2023
cortinico
pushed a commit
to cortinico/detekt
that referenced
this pull request
Jul 15, 2023
mgroth0
pushed a commit
to mgroth0/detekt
that referenced
this pull request
Feb 11, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes #6168. Currently,
UseDataClasswill report an error even if the class has a non-property parameter as seen in the example:Making this a
data classwould not compile, so the rule should not report it. This resolves that issue by checking to make sure that the class does not contain any non-property parameters before reporting it.