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 indent comments inside multi-line Elvis expressions #1545

Merged
merged 7 commits into from
Nov 7, 2022

Conversation

0x6675636b796f75676974687562
Copy link
Member

@0x6675636b796f75676974687562 0x6675636b796f75676974687562 commented Nov 1, 2022

What's done:

### What's done:

 * Now, EOL and block comments within multi-line Elvis expressions have the same
   indentation level as the immediately following Elvis operator (`?:`), e.g.:
   ```kotlin
   fun foo() {
       findProperty("dockerNetwork") as String?
           // https://docs.docker.com/compose/networking/
           ?: "default"
   }
   ```
 * This fixes #1532.
@codecov
Copy link

codecov bot commented Nov 1, 2022

Codecov Report

Merging #1545 (1e36180) into master (2a0386e) will increase coverage by 0.01%.
The diff coverage is 77.35%.

@@             Coverage Diff              @@
##             master    #1545      +/-   ##
============================================
+ Coverage     82.10%   82.11%   +0.01%     
  Complexity     2311     2311              
============================================
  Files           112      112              
  Lines          7801     7835      +34     
  Branches       2015     2030      +15     
============================================
+ Hits           6405     6434      +29     
  Misses          481      481              
- Partials        915      920       +5     
Flag Coverage Δ
unittests 82.11% <77.35%> (+0.01%) ⬆️

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

Impacted Files Coverage Δ
...qfn/diktat/ruleset/rules/chapter4/SmartCastRule.kt 50.71% <0.00%> (ø)
...et/rules/chapter6/classes/CompactInitialization.kt 84.54% <0.00%> (ø)
.../ruleset/rules/chapter6/classes/DataClassesRule.kt 86.56% <50.00%> (ø)
...tlin/org/cqfn/diktat/ruleset/utils/AstNodeUtils.kt 81.81% <61.11%> (-1.09%) ⬇️
.../cqfn/diktat/ruleset/utils/indentation/Checkers.kt 84.28% <92.85%> (+3.64%) ⬆️
.../chapter4/calculations/AccurateCalculationsRule.kt 77.77% <100.00%> (ø)
...n/kotlin/org/cqfn/diktat/ruleset/utils/PsiUtils.kt 57.14% <100.00%> (ø)
...qfn/diktat/ruleset/utils/search/VariablesSearch.kt 90.90% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 1, 2022

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

1 993 tests   1 978 ✔️  5m 50s ⏱️
   162 suites       15 💤
   162 files           0

Results for commit 1e36180.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 1, 2022

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

1 974 tests   1 959 ✔️  2m 8s ⏱️
   161 suites       15 💤
   161 files           0

Results for commit 1e36180.

♻️ This comment has been updated with latest results.

@0x6675636b796f75676974687562 0x6675636b796f75676974687562 deleted the bugfix/andrey.shcheglov/a branch November 7, 2022 13:14
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.

IndentationRule: Comment is not indented on the line before elvis operator
2 participants