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

Fixed BracesInConditionalsAndLoopsRule and added tests #1750

Merged
merged 3 commits into from
Sep 25, 2023

Conversation

DrAlexD
Copy link
Member

@DrAlexD DrAlexD commented Sep 25, 2023

What's done:

  • Reworked insertEmptyBlock() function for adding empty braces blocks to conditions and do-while loop with empty bodies.
  • Added check for braces block existence to avoid duplicate braces block.
  • Added tests for conditions including tests for cases of else if and cases of empty if and else bodies.

It's part of #1737

### What's done:
- Reworked `insertEmptyBlock()` function for adding empty braces blocks to conditions and `do-while` loop with empty bodies.
- Added check for braces block existence to avoid duplicate braces block.
- Added tests for conditions including tests for cases of `else if` and cases of empty `if` and `else` bodies.

It's part of saveourtool#1737
@DrAlexD DrAlexD requested a review from nulls September 25, 2023 10:52
@DrAlexD DrAlexD self-assigned this Sep 25, 2023
@DrAlexD DrAlexD added the tests Improve testing label Sep 25, 2023
@DrAlexD DrAlexD added this to the 2.0.0 milestone Sep 25, 2023
@codecov
Copy link

codecov bot commented Sep 25, 2023

Codecov Report

Merging #1750 (3fdde5f) into master (17d4bcc) will increase coverage by 0.30%.
The diff coverage is 73.33%.

@@             Coverage Diff              @@
##             master    #1750      +/-   ##
============================================
+ Coverage     76.10%   76.40%   +0.30%     
- Complexity     2283     2296      +13     
============================================
  Files           126      126              
  Lines          8243     8273      +30     
  Branches       2070     2081      +11     
============================================
+ Hits           6273     6321      +48     
+ Misses         1050     1027      -23     
- Partials        920      925       +5     
Files Changed Coverage Δ
...rules/chapter3/BracesInConditionalsAndLoopsRule.kt 84.44% <73.33%> (+21.58%) ⬆️

@DrAlexD DrAlexD enabled auto-merge (squash) September 25, 2023 12:14
@DrAlexD DrAlexD merged commit 3c4e688 into saveourtool:master Sep 25, 2023
26 of 27 checks passed
@DrAlexD DrAlexD deleted the feature/fix-braces-rule branch September 25, 2023 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Improve testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants