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

Properly format expressions wrapped *before* a binary operator #1486

Merged

Conversation

0x6675636b796f75676974687562
Copy link
Member

What's done:

### What's done:

 * Now, the indentation in binary expressions wrapped *before* a binary operator
   or an infix function is also controlled with `extendedIndentAfterOperators`.
 * The above is also true for `as` and `as?` operators.
 * The only exclusion is the Elvis operator (`?:`).
 * Fixes #1340.
@codecov
Copy link

codecov bot commented Jul 29, 2022

Codecov Report

Merging #1486 (6b0eb75) into master (d354d88) will decrease coverage by 0.00%.
The diff coverage is 85.71%.

@@             Coverage Diff              @@
##             master    #1486      +/-   ##
============================================
- Coverage     82.96%   82.96%   -0.01%     
  Complexity     2579     2579              
============================================
  Files           111      111              
  Lines          7708     7712       +4     
  Branches       2111     2114       +3     
============================================
+ Hits           6395     6398       +3     
  Misses          418      418              
- Partials        895      896       +1     
Flag Coverage Δ
unittests 82.96% <85.71%> (-0.01%) ⬇️

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

Impacted Files Coverage Δ
...tlin/org/cqfn/diktat/ruleset/utils/AstNodeUtils.kt 82.70% <ø> (ø)
.../cqfn/diktat/ruleset/utils/indentation/Checkers.kt 83.06% <80.00%> (-0.27%) ⬇️
.../diktat/ruleset/rules/chapter2/kdoc/KdocMethods.kt 87.42% <100.00%> (ø)
...qfn/diktat/ruleset/rules/chapter4/SmartCastRule.kt 50.71% <100.00%> (ø)

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 d354d88...6b0eb75. Read the comment docs.

@github-actions
Copy link
Contributor

JUnit Tests (macOS, EnricoMi/publish-unit-test-result-action@v1)

1 325 tests   1 310 ✔️  1m 47s ⏱️
   163 suites       15 💤
   163 files           0

Results for commit 6b0eb75.

@github-actions
Copy link
Contributor

JUnit Tests (Windows, EnricoMi/publish-unit-test-result-action@v1)

1 340 tests   1 325 ✔️  3m 44s ⏱️
   164 suites       15 💤
   164 files           0

Results for commit 6b0eb75.

@0x6675636b796f75676974687562 0x6675636b796f75676974687562 deleted the bugfix/andrey.shcheglov/indentation branch July 29, 2022 16:31
@@ -605,6 +605,29 @@ internal object IndentationRuleTestResources {
| 2 to
| 3))
""".trimMargin(),

Copy link
Member

Choose a reason for hiding this comment

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

Actually - I suggest to split resources - we don't need to have huge unit tests that have complex logic (especially when warnings are far away from the code)

softly.assertThat(lintResult(code, customConfig.asRulesConfigList()))
.describedAs("lint result for ${code.describe()}")
.isNotEmpty
.hasSizeBetween(1, 5).allSatisfy(Consumer { lintError ->
Copy link
Member

Choose a reason for hiding this comment

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

expecting from 1 to 5 warnings :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants