-
-
Notifications
You must be signed in to change notification settings - Fork 794
ClassOrdering reports a message describing the misorder #3138
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
ClassOrdering reports a message describing the misorder #3138
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3138 +/- ##
============================================
+ Coverage 79.43% 79.46% +0.02%
+ Complexity 2597 2591 -6
============================================
Files 437 437
Lines 7820 7830 +10
Branches 1484 1490 +6
============================================
+ Hits 6212 6222 +10
Misses 819 819
Partials 789 789
Continue to review full report at Codecov.
|
@BraisGabin @schalkms This is my first detekt PR, what is the process for reviews? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great first PR!
Could you add some asserts over the message in the tests? The code that build the message is kind of complex.
And, could you add the missing parts that you found from this rule in a new issue so we can track them? If you want to do those PRs we can assign that issue to you.
@BraisGabin thanks! |
val findings = subject.compileAndLint(code) | ||
assertThat(findings).hasSize(1) | ||
assertThat(findings[0].message).isEqualTo("OutOfOrder (secondary constructor) " + | ||
"should not come before null (class initializer)") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
null
is kind of strange here, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea, so is Companion (companion)
- fixed in 511e8c9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice job!!
@BraisGabin thanks! how does this get merged? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! @hbmartin 🙂
ClassOrdering
rule reports its own description as a message. This PR modifies the message to report the specific entities identified as out of order.