-
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
Bugfix/long line in string template #1297
Conversation
* Start logic to fix and warn String Template in Linelength rule
# Conflicts: # diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/chapter3/LineLength.kt
* Start logic to fix and warn String Template in Linelength rule
* Start logic to fix and warn String Template in Linelength rule
* corrected logic fix and warn String Template in Linelength rule * added logic fix and warn long Dot Qualified Expression in LineLength rule * added logic fix and warn Value Arguments List in LineLength rule * added and corrected fix and warn tests in LineLength rule ### Issue (#1243)
* corrected logic fix and warn String Template in Linelength rule * added logic fix and warn long Dot Qualified Expression in LineLength rule * added logic fix and warn Value Arguments List in LineLength rule * added and corrected fix and warn tests in LineLength rule * fix code with diktat:fix@diktat ### Issue (#1243)
* corrected logic fix and warn String Template in Linelength rule * added logic fix and warn long Dot Qualified Expression in LineLength rule * added logic fix and warn Value Arguments List in LineLength rule * added and corrected fix and warn tests in LineLength rule * fix code with diktat:fix@diktat * added comments to classes and functions ### Issue (#1243)
Codecov Report
@@ Coverage Diff @@
## master #1297 +/- ##
============================================
- Coverage 83.67% 83.56% -0.12%
+ Complexity 2588 2572 -16
============================================
Files 106 106
Lines 7387 7507 +120
Branches 2048 2076 +28
============================================
+ Hits 6181 6273 +92
- Misses 354 357 +3
- Partials 852 877 +25
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
* corrected logic fix and warn String Template in Linelength rule * added logic fix and warn long Dot Qualified Expression in LineLength rule * added logic fix and warn Value Arguments List in LineLength rule * added and corrected fix and warn tests in LineLength rule * fix code with diktat:fix@diktat * added comments to classes and functions * correct code with running detect ### Issue (#1243)
* corrected logic fix and warn String Template in Linelength rule * added logic fix and warn long Dot Qualified Expression in LineLength rule * added logic fix and warn Value Arguments List in LineLength rule * added and corrected fix and warn tests in LineLength rule * fix code with diktat:fix@diktat * added comments to classes and functions * correct code with running detect ### Issue (#1243)
* corrected logic fix and warn String Template in Linelength rule * added logic fix and warn long Dot Qualified Expression in LineLength rule * added logic fix and warn Value Arguments List in LineLength rule * added and corrected fix and warn tests in LineLength rule * fix code with diktat:fix@diktat * added comments to classes and functions * correct code with running detect ### Issue (#1243)
* corrected logic fix and warn String Template in Linelength rule * added logic fix and warn long Dot Qualified Expression in LineLength rule * added logic fix and warn Value Arguments List in LineLength rule * added and corrected fix and warn tests in LineLength rule * fix code with diktat:fix@diktat * added comments to classes and functions * correct code with running detect ### Issue (#1243)
* corrected logic fix and warn String Template in Linelength rule * added logic fix and warn long Dot Qualified Expression in LineLength rule * added logic fix and warn Value Arguments List in LineLength rule * added and corrected fix and warn tests in LineLength rule * fix code with diktat:fix@diktat * added comments to classes and functions * correct code with running detect ### Issue (#1243)
* corrected logic fix and warn String Template in Linelength rule * added logic fix and warn long Dot Qualified Expression in LineLength rule * added logic fix and warn Value Arguments List in LineLength rule * added and corrected fix and warn tests in LineLength rule * fix code with diktat:fix@diktat * added comments to classes and functions * correct code with running detect ### Issue (#1243)
* corrected logic fix and warn String Template in Linelength rule * added logic fix and warn long Dot Qualified Expression in LineLength rule * added logic fix and warn Value Arguments List in LineLength rule * added and corrected fix and warn tests in LineLength rule * fix code with diktat:fix@diktat * added comments to classes and functions * correct code with running detect ### Issue (#1243)
* corrected logic fix and warn String Template in Linelength rule * added logic fix and warn long Dot Qualified Expression and Safe Access Expression in LineLength rule * added logic fix and warn Value Arguments List in LineLength rule * added and corrected fix and warn tests in LineLength rule * fix code with diktat:fix@diktat * added comments to classes and functions * correct code with running detect ### Issue (#1243)
* corrected logic fix and warn String Template in Linelength rule * added logic fix and warn long Dot Qualified Expression and Safe Access Expression in LineLength rule * added logic fix and warn Value Arguments List in LineLength rule * added and corrected fix and warn tests in LineLength rule * fix code with diktat:fix@diktat * added comments to classes and functions * correct code with running detect ### Issue (#1243)
* corrected logic fix and warn String Template in Linelength rule * added logic fix and warn long Dot Qualified Expression and Safe Access Expression in LineLength rule * added logic fix and warn Value Arguments List in LineLength rule * added and corrected fix and warn tests in LineLength rule * fix code with diktat:fix@diktat * added comments to classes and functions * correct code with running detect ### Issue (#1243)
* corrected logic fix and warn String Template in Linelength rule * added logic fix and warn long Dot Qualified Expression and Safe Access Expression in LineLength rule * added logic fix and warn Value Arguments List in LineLength rule * added and corrected fix and warn tests in LineLength rule * fix code with diktat:fix@diktat * added comments to classes and functions * correct code with running detect ### Issue (#1243)
* corrected logic fix and warn String Template in LineLength rule * added logic fix and warn long Dot Qualified Expression and Safe Access Expression in LineLength rule * added logic fix and warn Value Arguments List in LineLength rule * added and corrected fix and warn tests in LineLength rule * fix code with diktat:fix@diktat * added comments to classes and functions * correct code with running detect ### Issue (#1243)
diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/utils/AstNodeUtils.kt
Outdated
Show resolved
Hide resolved
diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/chapter3/LineLength.kt
Show resolved
Hide resolved
diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/chapter3/LineLength.kt
Outdated
Show resolved
Hide resolved
diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/chapter3/LineLength.kt
Outdated
Show resolved
Hide resolved
diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/chapter3/LineLength.kt
Outdated
Show resolved
Hide resolved
### Whats added: * corrected logic fix and warn String Template in LineLength rule * added logic fix and warn long Dot Qualified Expression and Safe Access Expression in LineLength rule * added logic fix and warn Value Arguments List in LineLength rule * added and corrected fix and warn tests in LineLength rule * moved fix logic to class methods * fix code with diktat:fix@diktat * added comments to classes and functions * corrected code ### Issue (#1243)
diktat-common/src/main/kotlin/org/cqfn/diktat/common/config/rules/RulesConfigReader.kt
Fixed
Show fixed
Hide fixed
diktat-common/src/main/kotlin/org/cqfn/diktat/common/config/rules/RulesConfigReader.kt
Fixed
Show fixed
Hide fixed
diktat-common/src/main/kotlin/org/cqfn/diktat/common/config/rules/RulesConfigReader.kt
Fixed
Show fixed
Hide fixed
diktat-common/src/main/kotlin/org/cqfn/diktat/common/config/rules/RulesConfigReader.kt
Fixed
Show fixed
Hide fixed
diktat-common/src/main/kotlin/org/cqfn/diktat/common/config/rules/RulesConfigReader.kt
Fixed
Show fixed
Hide fixed
diktat-common/src/main/kotlin/org/cqfn/diktat/common/config/rules/RulesConfigReader.kt
Fixed
Show fixed
Hide fixed
### Whats added: * corrected logic fix and warn String Template in LineLength rule * added logic fix and warn long Dot Qualified Expression and Safe Access Expression in LineLength rule * added logic fix and warn Value Arguments List in LineLength rule * added and corrected fix and warn tests in LineLength rule * moved fix logic to class methods * fix code with diktat:fix@diktat * added comments to classes and functions * corrected code ### Issue (#1243)
### Whats added: * corrected logic fix and warn String Template in LineLength rule * added logic fix and warn long Dot Qualified Expression and Safe Access Expression in LineLength rule * added logic fix and warn Value Arguments List in LineLength rule * added and corrected fix and warn tests in LineLength rule * moved fix logic to class methods * fix code with diktat:fix@diktat * added comments to classes and functions * corrected code ### Issue (#1243)
diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/chapter3/LineLength.kt
Fixed
Show fixed
Hide fixed
diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/chapter3/LineLength.kt
Fixed
Show fixed
Hide fixed
diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/chapter3/LineLength.kt
Fixed
Show fixed
Hide fixed
### Whats added: * corrected logic fix and warn String Template in LineLength rule * added logic fix and warn long Dot Qualified Expression and Safe Access Expression in LineLength rule * added logic fix and warn Value Arguments List in LineLength rule * added and corrected fix and warn tests in LineLength rule * moved fix logic to class methods * fix code with diktat:fix@diktat * added comments to classes and functions * corrected code ### Issue (#1243)
### Whats added: * corrected logic fix and warn String Template in LineLength rule * added logic fix and warn long Dot Qualified Expression and Safe Access Expression in LineLength rule * added logic fix and warn Value Arguments List in LineLength rule * added and corrected fix and warn tests in LineLength rule * moved fix logic to class methods * fix code with diktat:fix@diktat * added comments to classes and functions * corrected code ### Issue (#1243)
### Whats added: * corrected logic fix and warn String Template in LineLength rule * added logic fix and warn long Dot Qualified Expression and Safe Access Expression in LineLength rule * added logic fix and warn Value Arguments List in LineLength rule * added and corrected fix and warn tests in LineLength rule * moved fix logic to class methods * fix code with diktat:fix@diktat * added comments to classes and functions * corrected code ### Issue (#1243)
### Whats added: * corrected logic fix and warn String Template in LineLength rule * added logic fix and warn long Dot Qualified Expression and Safe Access Expression in LineLength rule * added logic fix and warn Value Arguments List in LineLength rule * added and corrected fix and warn tests in LineLength rule * moved fix logic to class methods * fix code with diktat:fix@diktat * added comments to classes and functions * corrected code ### Issue (#1243)
### Whats added: * corrected logic fix and warn String Template in LineLength rule * added logic fix and warn long Dot Qualified Expression and Safe Access Expression in LineLength rule * added logic fix and warn Value Arguments List in LineLength rule * added and corrected fix and warn tests in LineLength rule * moved fix logic to class methods * fix code with diktat:fix@diktat * added comments to classes and functions * corrected code ### Issue (#1243)
### Whats added: * corrected logic fix and warn String Template in LineLength rule * added logic fix and warn long Dot Qualified Expression and Safe Access Expression in LineLength rule * added logic fix and warn Value Arguments List in LineLength rule * added and corrected fix and warn tests in LineLength rule * moved fix logic to class methods * fix code with diktat:fix@diktat * added comments to classes and functions * corrected code ### Issue (#1243)
diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/chapter3/LineLength.kt
Fixed
Show fixed
Hide fixed
### Whats added: * corrected logic fix and warn String Template in LineLength rule * added logic fix and warn long Dot Qualified Expression and Safe Access Expression in LineLength rule * added logic fix and warn Value Arguments List in LineLength rule * added and corrected fix and warn tests in LineLength rule * moved fix logic to class methods * fix code with diktat:fix@diktat * added comments to classes and functions * corrected code ### Issue (#1243)
val parentIsFunctionLiteral = parent.treeParent.treeParent.elementType == FUNCTION_LITERAL | ||
val parentIsFunOrProperty = parent.treeParent.elementType in listOf(FUN, PROPERTY) | ||
return (parentIsBiExprOrParenthesized || parentIsFunctionLiteral || (parentIsFunOrProperty && offset >= configuration.lineLength)) | ||
private fun findParentNodeMatching(node: ASTNode, listType: List<IElementType>): ASTNode? { |
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.
suggestion to extend org.cqfn.diktat.ruleset.utils.AstNodeUtilsKt#findParentNodeWithSpecificType
to support elementType
as varags
return binList.map { | ||
it to positionByOffset(it.getFirstChildWithType(OPERATION_REFERENCE)!!.startOffset).second | ||
} | ||
@Suppress("MAGIC_NUMBER", "MagicNumber") |
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.
@akuleshov7 @petertrr, as I got, there are two different rules from diktat and detect -- is it possible to support suppressing from detect on diktat level to avoid duplication?
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 should probably tune detekt.yaml
a little and turn off these overlapping rules.
…e' into bugfix/LongLine_in_StringTemplate
Fix logic in LineLength rule
This pull request closes #1243
Actions checklist