-
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
Kdoc fixer: not ask @return on simple delegating getters: #1022
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1022 +/- ##
============================================
- Coverage 83.80% 83.79% -0.02%
- Complexity 2424 2428 +4
============================================
Files 102 102
Lines 6108 6114 +6
Branches 1809 1811 +2
============================================
+ Hits 5119 5123 +4
Misses 273 273
- Partials 716 718 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/chapter2/kdoc/KdocMethods.kt
Outdated
Show resolved
Hide resolved
diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/chapter2/kdoc/KdocMethods.kt
Outdated
Show resolved
Hide resolved
if (node.isSingleLineGetterOrSetter()) { | ||
return false | ||
} | ||
val lastDotQualifiedExpression = node.findChildByType(DOT_QUALIFIED_EXPRESSION)?.text?.substringAfterLast('.') |
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.
foo.bar(x.prop)
will yield prop)
with this logic, if I understand correctly. And you need bar
diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/chapter2/kdoc/KdocMethods.kt
Outdated
Show resolved
Hide resolved
diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/chapter2/kdoc/KdocMethods.kt
Outdated
Show resolved
Hide resolved
diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/chapter2/kdoc/KdocMethods.kt
Outdated
Show resolved
Hide resolved
return funName == lastDotQualifiedExpression | ||
} | ||
|
||
@Suppress("WRONG_NEWLINES") |
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.
Why did you suppress it?)
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.
The Diktat merge 2 lines into one, and then breaks down on LONG_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.
Then please create an issue with a reproducer, it looks like behavior that we need to avoid
import com.pinterest.ktlint.core.ast.ElementType.ENUM_KEYWORD | ||
import com.pinterest.ktlint.core.ast.ElementType.FUN | ||
import com.pinterest.ktlint.core.ast.ElementType.INNER_KEYWORD | ||
import com.pinterest.ktlint.core.ast.ElementType.INTERFACE_KEYWORD |
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's not the first time that I see how diktat removes unused imports in a file, on which it hasn't complained before. Do you have any thought, why this can happen?
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.
Yes. We need to investigate this
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.
Please create an issue about this too
diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/chapter2/kdoc/KdocMethods.kt
Outdated
Show resolved
Hide resolved
### What's done: * fixed bug in WRONG_NEWLINES Closes #965
What's done:
Closes Kdoc fixer false-negative: not generating a Kdoc for several public functions #965