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

Bugfix/new lines rule dot qualified expression and safe access expression #1337

Merged
merged 32 commits into from
Jun 15, 2022

Conversation

Arrgentum
Copy link
Member

@Arrgentum Arrgentum commented May 31, 2022

This pull request close #865

Actions checklist

  • Add logic Dot Qualified Expression, Postfix Expression, Safe Access Expression
  • Corrected tests on checks
  • Added tests on fixers
  • Corrected code and KDoc in method appendNewlineMergingWhiteSpace in AstNodeUtils.kt

Issue ( #865)

Arrgentum added 12 commits May 25, 2022 14:47
 * 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 long Dot Qualified Expression

 ### Issue (#865)
 * corrected logic fix and warn long Dot Qualified Expression and Safe Access Expression

 ### Issue (#865)
 * corrected logic fix and warn long Dot Qualified Expression and Safe Access Expression

 ### Issue (#865)
 * corrected logic fix and warn long Dot Qualified Expression and Safe Access Expression

 ### Issue (#865)
 * corrected logic fix and warn long Dot Qualified Expression and Safe Access Expression and Postfix Expression

 ### Issue (#865)
 * corrected logic fix and warn long Dot Qualified Expression and Safe Access Expression and Postfix Expression

 ### Issue (#865)
 rewrite code

 ### Issue (#865)
 * 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)
 * 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)
 * 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)
 * 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)
@codecov
Copy link

codecov bot commented May 31, 2022

Codecov Report

Merging #1337 (07487f1) into master (b3d32e2) will increase coverage by 0.04%.
The diff coverage is 81.60%.

@@             Coverage Diff              @@
##             master    #1337      +/-   ##
============================================
+ Coverage     83.59%   83.64%   +0.04%     
- Complexity     2567     2588      +21     
============================================
  Files           106      106              
  Lines          7291     7386      +95     
  Branches       2018     2048      +30     
============================================
+ Hits           6095     6178      +83     
  Misses          353      353              
- Partials        843      855      +12     
Flag Coverage Δ
unittests 83.64% <81.60%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...leset/rules/chapter2/comments/HeaderCommentRule.kt 86.61% <25.00%> (-1.29%) ⬇️
...ruleset/rules/chapter3/CollapseIfStatementsRule.kt 85.84% <25.00%> (-1.77%) ⬇️
.../ruleset/rules/chapter3/files/FileStructureRule.kt 83.76% <33.33%> (-0.36%) ⬇️
...fn/diktat/ruleset/rules/chapter4/NullChecksRule.kt 83.21% <33.33%> (-1.00%) ⬇️
...ruleset/rules/chapter3/StringTemplateFormatRule.kt 87.27% <75.00%> (+0.73%) ⬆️
...uleset/rules/chapter6/classes/InlineClassesRule.kt 80.00% <75.00%> (+2.58%) ⬆️
...iktat/ruleset/rules/chapter3/files/NewlinesRule.kt 81.08% <85.71%> (+0.72%) ⬆️
.../cqfn/diktat/ruleset/utils/indentation/Checkers.kt 76.92% <87.50%> (+1.03%) ⬆️
...tat/ruleset/rules/chapter3/files/WhiteSpaceRule.kt 82.74% <90.00%> (+0.54%) ⬆️
.../ruleset/rules/chapter2/kdoc/CommentsFormatting.kt 74.09% <100.00%> (+0.40%) ⬆️
... and 8 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b3d32e2...07487f1. Read the comment docs.

Arrgentum and others added 12 commits May 31, 2022 17:16
 * 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)
 * 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 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)
 * 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)
### 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)
### 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)
### 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)
### 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)
### 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)
### 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)
### 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)
### 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)
import org.cqfn.diktat.ruleset.utils.isGradleScript
import org.cqfn.diktat.ruleset.utils.isSingleLineIfElse
import org.cqfn.diktat.ruleset.utils.leaveOnlyOneNewLine
import org.cqfn.diktat.ruleset.utils.*
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now, when we have an editor config - we should prohibit wildcard imports

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please enable it in diktat-analysis

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's in the excludes, sorry, no need to change

@@ -135,11 +122,68 @@ class NewlinesRule(configRules: List<RulesConfig>) : DiktatRule(
BLOCK -> handleLambdaBody(node)
RETURN -> handleReturnStatement(node)
SUPER_TYPE_LIST, VALUE_PARAMETER_LIST, VALUE_ARGUMENT_LIST -> handleList(node)
DOT_QUALIFIED_EXPRESSION, SAFE_ACCESS_EXPRESSION, POSTFIX_EXPRESSION -> handDotQualifiedAndSafeAccessExpression(node)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should have fixed previous logic and not make a new one...

image

Copy link
Member

@orchestr7 orchestr7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please check the following logic and add a test:

        val value = decodeValue()
            .

            toString()

Arrgentum and others added 2 commits June 9, 2022 15:01
### 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 3 commits June 9, 2022 15:28
### 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)
…xpression' into bugfix/NewLinesRuleDotQualifiedExpression
### 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 Arrgentum merged commit 3dcd13e into master Jun 15, 2022
@Arrgentum Arrgentum deleted the bugfix/NewLinesRuleDotQualifiedExpression branch June 15, 2022 15:03
@Arrgentum Arrgentum self-assigned this Jun 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Investigate code-formating problem
3 participants