-
Notifications
You must be signed in to change notification settings - Fork 39
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
Making diktat consistent with own code style (rules.kdoc + diktat-rules tests) #485
Conversation
### What's done: * Applied code style in kdoc rules
Codecov Report
@@ Coverage Diff @@
## master #485 +/- ##
============================================
+ Coverage 81.74% 81.83% +0.08%
- Complexity 1499 1501 +2
============================================
Files 71 71
Lines 3731 3765 +34
Branches 1203 1209 +6
============================================
+ Hits 3050 3081 +31
- Misses 209 210 +1
- Partials 472 474 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
### What's done: * detekt code check
…c-rules' into feature/diktat-code-style-in-kdoc-rules
### What's done: * Updated tests in diktat-rules
…c-rules' into feature/diktat-code-style-in-kdoc-rules
@@ -6,6 +6,8 @@ import org.cqfn.diktat.common.config.rules.isRuleEnabled | |||
import org.cqfn.diktat.ruleset.utils.hasSuppress | |||
import org.jetbrains.kotlin.com.intellij.lang.ASTNode | |||
|
|||
typealias EmitType = ((offset: Int, errorMessage: String, canBeAutoCorrected: Boolean) -> Unit) |
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.
fair enough :)
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.
lgtm
it.assertThat(actual.ruleId).`as`("Rule id").isEqualTo(expected.ruleId) | ||
it.assertThat(actual.detail).`as`("Detailed message").isEqualTo(expected.detail) | ||
it.assertThat(actual.canBeAutoCorrected).`as`("Can be autocorrected").isEqualTo(expected.canBeAutoCorrected) | ||
it.assertThat(actual.line) |
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.
looks a little bit strange for short statements, but looks good for long. Where is the balance?
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.
It actually even isn't compliant with our current code style: we are forcing a line break after it
, but I thought it looks too ugly. I'll add an issue about making this rule prettier and maybe taking into account text length.
What's done: