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? |
BraisGabin
left a comment
There was a problem hiding this comment.
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.
null is kind of strange here, right?
There was a problem hiding this comment.
Yea, so is Companion (companion) - fixed in 511e8c9
|
@BraisGabin thanks! how does this get merged? |
ClassOrderingrule reports its own description as a message. This PR modifies the message to report the specific entities identified as out of order.