Skip to content

Commit

Permalink
### Whats added:
Browse files Browse the repository at this point in the history
 * 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
 * corrected code and KDoc in method appendNewlineMergingWhiteSpace in AstNodeUtils.kt
 * fix code with diktat:fix@diktat
 * added comments to classes and functions
 * correct code with running detect

 ### Issue (#1243)
  • Loading branch information
Arrgentum committed May 31, 2022
1 parent e7fc444 commit 09812b6
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -567,14 +567,14 @@ class LineLength(configRules: List<RulesConfig>) : DiktatRule(
*@param node node in which to search
*@param dotList mutable list of ASTNode to store nodes
*/
private fun searchDot(node: ASTNode, dotList: MutableList<ASTNode>) {
private fun searchDotOrSafeAccess(node: ASTNode, dotList: MutableList<ASTNode>) {
if (node.elementType == DOT_QUALIFIED_EXPRESSION || node.elementType == SAFE_ACCESS_EXPRESSION || node.elementType == POSTFIX_EXPRESSION) {
node.getChildren(null)
.filter {
it.elementType == DOT_QUALIFIED_EXPRESSION || it.elementType == SAFE_ACCESS_EXPRESSION || it.elementType == POSTFIX_EXPRESSION
}
.forEach {
searchDot(it, dotList)
searchDotOrSafeAccess(it, dotList)
}
if (node.elementType != POSTFIX_EXPRESSION) {
dotList.add(node)
Expand Down

0 comments on commit 09812b6

Please sign in to comment.