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

NO_BRACES_IN_CONDITIONALS_AND_LOOPS fail within variable initialization block #1739

Merged
merged 4 commits into from
Sep 25, 2023

Conversation

DrAlexD
Copy link
Member

@DrAlexD DrAlexD commented Sep 20, 2023

What's done:

  • Provide fix
  • Add test

Closes #1270

* Provide fix
* Add test

Closes saveourtool#1270
@codecov
Copy link

codecov bot commented Sep 20, 2023

Codecov Report

Merging #1739 (d15ee36) into master (eb6ef05) will increase coverage by 0.07%.
The diff coverage is 61.53%.

@@             Coverage Diff              @@
##             master    #1739      +/-   ##
============================================
+ Coverage     76.02%   76.10%   +0.07%     
- Complexity     2281     2283       +2     
============================================
  Files           126      126              
  Lines          8242     8243       +1     
  Branches       2069     2070       +1     
============================================
+ Hits           6266     6273       +7     
+ Misses         1060     1050      -10     
- Partials        916      920       +4     
Files Changed Coverage Δ
...rules/chapter3/BracesInConditionalsAndLoopsRule.kt 62.85% <61.53%> (+6.12%) ⬆️

…e function

### What's done:
* added findIndentBeforeNode() function
* reworked test for loops
* added test for conditions
* fixed indent handling by using safe call for case when `if` comes after bracket
* fixed indent handling for `else if` case
* added test for `else if` case
@nulls nulls added tests Improve testing enhancement New feature or request labels Sep 25, 2023
@nulls nulls added this to the 2.0.0 milestone Sep 25, 2023
@DrAlexD DrAlexD merged commit 17d4bcc into saveourtool:master Sep 25, 2023
26 of 27 checks passed
@DrAlexD DrAlexD deleted the bugfix/no-braces-loops branch September 25, 2023 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request tests Improve testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[NO_BRACES_IN_CONDITIONALS_AND_LOOPS] fail within variable initialization block
2 participants