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. Indentation inside string templates(#758) #765

Merged
merged 9 commits into from
Feb 16, 2021

Conversation

aktsay6
Copy link
Collaborator

@aktsay6 aktsay6 commented Feb 11, 2021

What's done:

  • Added test
  • Fixed bug

This pull request closes #758

Actions checklist

  • Implemented Rule, added Warnings
  • Added tests on checks
  • Added tests on fixers
  • Updated diktat-analysis.yml
  • Updated available-rules.md

### What's done:
  * Added a simple test
### What's done:
  * Fixed bugs
  * Added tests
@aktsay6 aktsay6 added the bug Something isn't working label Feb 11, 2021
@aktsay6 aktsay6 requested review from petertrr and kentr0w February 11, 2021 08:17
@codecov
Copy link

codecov bot commented Feb 11, 2021

Codecov Report

Merging #765 (8713ce1) into master (83b9f1a) will decrease coverage by 0.06%.
The diff coverage is 53.33%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #765      +/-   ##
============================================
- Coverage     80.56%   80.49%   -0.07%     
- Complexity     2044     2046       +2     
============================================
  Files            97       97              
  Lines          5300     5307       +7     
  Branches       1637     1640       +3     
============================================
+ Hits           4270     4272       +2     
- Misses          247      250       +3     
- Partials        783      785       +2     
Flag Coverage Δ Complexity Δ
unittests 80.49% <53.33%> (-0.07%) 0.00 <1.00> (ø)

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

Impacted Files Coverage Δ Complexity Δ
.../cqfn/diktat/ruleset/utils/indentation/Checkers.kt 75.00% <40.00%> (-2.67%) 0.00 <0.00> (ø)
...at/ruleset/rules/chapter3/files/IndentationRule.kt 81.96% <80.00%> (-0.54%) 36.00 <1.00> (+2.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 83b9f1a...8713ce1. Read the comment docs.

|fun foo(some: String) {
| fun bar() {
| val a = "${'$'}{
| expression
Copy link
Collaborator

Choose a reason for hiding this comment

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

I corrected expression as it should be, but then it incorrectly detects the indentation of the bottom lines

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed

### What's done:
  * New bug with warn (fix work fine)
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.

lg for me, but please check comment from Denis and fix diktat code to be compatible with diktat

@aktsay6 aktsay6 requested a review from kentr0w February 16, 2021 07:40
Copy link
Collaborator

@kentr0w kentr0w left a comment

Choose a reason for hiding this comment

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

lgtm

@aktsay6 aktsay6 merged commit 1291bd7 into master Feb 16, 2021
@aktsay6 aktsay6 deleted the bugfix/indentation-inside-string-templates(#758) branch February 16, 2021 11:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Diktat should check indentation inside string templates in {}
4 participants