Skip to content
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

Investigate code-formating problem #865

Closed
kentr0w opened this issue Apr 30, 2021 · 2 comments · Fixed by #1337
Closed

Investigate code-formating problem #865

kentr0w opened this issue Apr 30, 2021 · 2 comments · Fixed by #1337
Assignees
Labels
autofix Issues related to diktat in autofix mode bug Something isn't working good first issue Good for newcomers
Milestone

Comments

@kentr0w
Copy link
Collaborator

kentr0w commented Apr 30, 2021

Invalide code

private fun ASTNode.getBreakNodeFromIf(type: IElementType) = this
        .treeParent
        .findChildByType(type)?.let {
            it.findChildByType(BLOCK) ?: it
        }?.hasChildOfType(BREAK) ?: false

Expected behavior

private fun ASTNode.getBreakNodeFromIf(type: IElementType) = this
        .treeParent
        .findChildByType(type)
        ?.let {
            it.findChildByType(BLOCK) ?: it
        }
        ?.hasChildOfType(BREAK) 
        ?: false

diktat version: 0.5.1

@kentr0w kentr0w added the bug Something isn't working label Apr 30, 2021
@petertrr petertrr added the autofix Issues related to diktat in autofix mode label Jul 1, 2021
@petertrr petertrr added this to the 1.0.0 milestone Aug 9, 2021
@petertrr
Copy link
Member

petertrr commented Aug 9, 2021

Probably something to do with the way we count function calls in chains (we have a threshold, under which we don't fix). I suppose, we should allow only single-line calls under the threshold.

@petertrr petertrr modified the milestones: 1.0.0, 1.1.0 Dec 12, 2021
@orchestr7 orchestr7 modified the milestones: 1.1.0, 1.1.1 Apr 13, 2022
@orchestr7 orchestr7 added the good first issue Good for newcomers label Apr 27, 2022
Arrgentum pushed a commit that referenced this issue May 25, 2022
 * corrected logic fix and warn long Dot Qualified Expression

 ### Issue (#865)
Arrgentum pushed a commit that referenced this issue May 25, 2022
 * corrected logic fix and warn long Dot Qualified Expression and Safe Access Expression

 ### Issue (#865)
Arrgentum pushed a commit that referenced this issue May 25, 2022
 * corrected logic fix and warn long Dot Qualified Expression and Safe Access Expression

 ### Issue (#865)
Arrgentum pushed a commit that referenced this issue May 25, 2022
 * corrected logic fix and warn long Dot Qualified Expression and Safe Access Expression

 ### Issue (#865)
Arrgentum pushed a commit that referenced this issue May 26, 2022
 * corrected logic fix and warn long Dot Qualified Expression and Safe Access Expression and Postfix Expression

 ### Issue (#865)
Arrgentum pushed a commit that referenced this issue May 26, 2022
 * corrected logic fix and warn long Dot Qualified Expression and Safe Access Expression and Postfix Expression

 ### Issue (#865)
Arrgentum pushed a commit that referenced this issue May 26, 2022
 * corrected NAME_ID

 ### Issue (#865)
Arrgentum pushed a commit that referenced this issue May 26, 2022
 * corrected 1 warn test

 ### Issue (#865)
Arrgentum pushed a commit that referenced this issue May 26, 2022
 * corrected 1 warn test

 ### Issue (#865)
Arrgentum pushed a commit that referenced this issue May 27, 2022
 rewrite code

 ### Issue (#865)
Arrgentum pushed a commit that referenced this issue May 31, 2022
 * corrected logic fix and warn long Dot Qualified Expression and Safe Access Expression and Postfix Expression
 * added fix test in NewLineRuleFixTest
 * corrected and added warnings in NewLineRuleWarnTest

 ### Issue (#865)
Arrgentum pushed a commit that referenced this issue May 31, 2022
 * corrected logic fix and warn long Dot Qualified Expression and Safe Access Expression and Postfix Expression
 * added fix test in NewLineRuleFixTest
 * corrected and added warnings in NewLineRuleWarnTest
 * run diktat:fix@diktat

 ### Issue (#865)
Arrgentum pushed a commit that referenced this issue May 31, 2022
 * corrected logic fix and warn long Dot Qualified Expression and Safe Access Expression and Postfix Expression
 * added fix test in NewLineRuleFixTest
 * corrected and added warnings in NewLineRuleWarnTest
 * run diktat:fix@diktat

  ### Issue (#865)
Arrgentum pushed a commit that referenced this issue May 31, 2022
 * corrected logic fix and warn long Dot Qualified Expression and Safe Access Expression and Postfix Expression
 * added fix test in NewLineRuleFixTest
 * corrected and added warnings in NewLineRuleWarnTest
 * run diktat:fix@diktat

  ### Issue (#865)
Arrgentum pushed a commit that referenced this issue Jun 1, 2022
 * corrected logic fix and warn long Dot Qualified Expression and Safe Access Expression and Postfix Expression
 * added fix test in NewLineRuleFixTest
 * corrected and added warnings in NewLineRuleWarnTest
 * run diktat:fix@diktat

  ### Issue (#865)
Arrgentum pushed a commit that referenced this issue Jun 1, 2022
 * corrected logic fix and warn long Dot Qualified Expression and Safe Access Expression and Postfix Expression
 * added fix test in NewLineRuleFixTest
 * corrected and added warnings in NewLineRuleWarnTest
 * run diktat:fix@diktat

  ### Issue (#865)
Arrgentum pushed a commit that referenced this issue Jun 1, 2022
### Whats added:
 * corrected logic fix and warn long Dot Qualified Expression and Safe Access Expression and Postfix Expression
 * added fix test in NewLineRuleFixTest
 * corrected and added warnings in NewLineRuleWarnTest
 * run diktat:fix@diktat

  ### Issue (#865)
Arrgentum pushed a commit that referenced this issue Jun 1, 2022
### Whats added:
 * corrected logic fix and warn long Dot Qualified Expression and Safe Access Expression and Postfix Expression
 * added fix test in NewLineRuleFixTest
 * corrected and added warnings in NewLineRuleWarnTest
 * run diktat:fix@diktat

  ### Issue (#865)
Arrgentum pushed a commit that referenced this issue Jun 1, 2022
### Whats added:
 * corrected logic fix and warn long Dot Qualified Expression and Safe Access Expression and Postfix Expression
 * added fix test in NewLineRuleFixTest
 * corrected and added warnings in NewLineRuleWarnTest
 * run diktat:fix@diktat

  ### Issue (#865)
Arrgentum pushed a commit that referenced this issue Jun 1, 2022
### Whats added:
 * corrected logic fix and warn long Dot Qualified Expression and Safe Access Expression and Postfix Expression
 * added fix test in NewLineRuleFixTest
 * corrected and added warnings in NewLineRuleWarnTest
 * run diktat:fix@diktat

  ### Issue (#865)
Arrgentum pushed a commit that referenced this issue Jun 1, 2022
### Whats added:
 * corrected logic fix and warn long Dot Qualified Expression and Safe Access Expression and Postfix Expression
 * added fix test in NewLineRuleFixTest
 * corrected and added warnings in NewLineRuleWarnTest
 * run diktat:fix@diktat

  ### Issue (#865)
Arrgentum pushed a commit that referenced this issue Jun 1, 2022
### Whats added:
 * corrected logic fix and warn long Dot Qualified Expression and Safe Access Expression and Postfix Expression
 * added fix test in NewLineRuleFixTest
 * corrected and added warnings in NewLineRuleWarnTest
 * run diktat:fix@diktat

  ### Issue (#865)
Arrgentum pushed a commit that referenced this issue Jun 3, 2022
### Whats added:
 * corrected logic fix and warn long Dot Qualified Expression and Safe Access Expression and Postfix Expression
 * added fix test in NewLineRuleFixTest
 * corrected and added warnings in NewLineRuleWarnTest
 * run diktat:fix@diktat

  ### Issue (#865)
Arrgentum pushed a commit that referenced this issue Jun 3, 2022
### Whats added:
 * corrected logic fix and warn long Dot Qualified Expression and Safe Access Expression and Postfix Expression
 * added fix test in NewLineRuleFixTest
 * corrected and added warnings in NewLineRuleWarnTest
 * run diktat:fix@diktat

  ### Issue (#865)
Arrgentum pushed a commit that referenced this issue Jun 9, 2022
### Whats added:
 * corrected logic fix and warn long Dot Qualified Expression and Safe Access Expression and Postfix Expression
 * commented on the choice of different logics with these expressions
 * added fix test in NewLineRuleFixTest
 * corrected and added warnings in NewLineRuleWarnTest
 * run diktat:fix@diktat

  ### Issue (#865)
Arrgentum pushed a commit that referenced this issue Jun 9, 2022
### Whats added:
 * corrected logic fix and warn long Dot Qualified Expression and Safe Access Expression and Postfix Expression
 * commented on the choice of different logics with these expressions
 * added fix test in NewLineRuleFixTest
 * corrected and added warnings in NewLineRuleWarnTest
 * run diktat:fix@diktat

  ### Issue (#865)
Arrgentum pushed a commit that referenced this issue Jun 9, 2022
### Whats added:
 * corrected logic fix and warn long Dot Qualified Expression and Safe Access Expression and Postfix Expression
 * commented on the choice of different logics with these expressions
 * added fix test in NewLineRuleFixTest
 * corrected and added warnings in NewLineRuleWarnTest
 * run diktat:fix@diktat

  ### Issue (#865)
Arrgentum added a commit that referenced this issue Jun 15, 2022
…sion (#1337)

### Whats added:
 * corrected logic fix and warn long Dot Qualified Expression and Safe Access Expression and Postfix Expression
 * commented on the choice of different logics with these expressions
 * added fix test in NewLineRuleFixTest
 * corrected and added warnings in NewLineRuleWarnTest
 
  ### Issue (#865)
@Arrgentum
Copy link
Member

close in #1337 Pull Request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autofix Issues related to diktat in autofix mode bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants