Skip to content

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

Merged
0x6675636b796f75676974687562 merged 2 commits intomasterfrom
bugfix/andrey.shcheglov/indentation
Jul 29, 2022
Merged

Properly format expressions wrapped *before* a binary operator#1486
0x6675636b796f75676974687562 merged 2 commits intomasterfrom
bugfix/andrey.shcheglov/indentation

Conversation

@0x6675636b796f75676974687562
Copy link
Copy Markdown
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
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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
| 2 to
| 3))
""".trimMargin(),

Copy link
Copy Markdown
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
Copy Markdown
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

Development

Successfully merging this pull request may close these issues.

WRONG_INDENTATION: extendedIndentAfterOperators ignored if lines are wrapped before a binary operator or an infix function

2 participants