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

Bugfixing of single binary expression wrapped in parentheses (long lines rule) #1416

Merged
merged 4 commits into from
Jun 30, 2022

Conversation

Arrgentum
Copy link
Member

@Arrgentum Arrgentum commented Jun 29, 2022

Whats added:

Error in method fix in class Binary Expression - if binary expression contained in parentheses find child with type operation references is null

This pull request closes #1415

Actions checklist

  • Correct logic
  • Added test on fixer

Any information:

  • In issue - Error message - ([LONG_LINE] this line is longer than allowed: max line length 180, but was 196), but this line has a large indentation - 32. The line has a length of 165.
  • Without other code modes does not work
  • In this fix test maximum linelength is 151

Arrgentum and others added 2 commits June 29, 2022 12:50
* Correct logic - if solo `binary expression` contained in `parentheses`
* Added 1 fix test

## Issue (#1415)
@Arrgentum Arrgentum requested review from sanyavertolet and nulls June 29, 2022 10:00
@codecov
Copy link

codecov bot commented Jun 29, 2022

Codecov Report

Merging #1416 (ccc0e0a) into master (cfd9eab) will decrease coverage by 0.01%.
The diff coverage is 60.00%.

@@             Coverage Diff              @@
##             master    #1416      +/-   ##
============================================
- Coverage     83.39%   83.37%   -0.02%     
  Complexity     2561     2561              
============================================
  Files           107      107              
  Lines          7601     7604       +3     
  Branches       2097     2100       +3     
============================================
+ Hits           6339     6340       +1     
  Misses          374      374              
- Partials        888      890       +2     
Flag Coverage Δ
unittests 83.37% <60.00%> (-0.02%) ⬇️

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

Impacted Files Coverage Δ
...g/cqfn/diktat/ruleset/rules/chapter3/LineLength.kt 84.16% <60.00%> (-0.41%) ⬇️

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 cfd9eab...ccc0e0a. Read the comment docs.

@github-actions
Copy link
Contributor

github-actions bot commented Jun 29, 2022

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

1 280 tests   1 265 ✔️  7m 17s ⏱️
   159 suites       15 💤
   159 files           0

Results for commit ccc0e0a.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Contributor

github-actions bot commented Jun 29, 2022

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

1 280 tests   1 265 ✔️  11m 10s ⏱️
   159 suites       15 💤
   159 files           0

Results for commit ccc0e0a.

♻️ This comment has been updated with latest results.

@Arrgentum Arrgentum changed the title Correct logic - if solo binary expression contained in parentheses Solo binary exprssion contained in parentheses Jun 29, 2022
@orchestr7 orchestr7 enabled auto-merge (squash) June 30, 2022 14:10
@orchestr7 orchestr7 disabled auto-merge June 30, 2022 14:10
@orchestr7 orchestr7 enabled auto-merge (squash) June 30, 2022 14:12
@orchestr7 orchestr7 merged commit 6c70495 into master Jun 30, 2022
@orchestr7 orchestr7 deleted the bugfix/ErrorInLongLine branch June 30, 2022 18:00
@orchestr7 orchestr7 changed the title Solo binary exprssion contained in parentheses Bugfixing of single binary expression wrapped in parentheses (long lines rule) Jun 30, 2022
@@ -107,4 +107,9 @@ class LineLengthFixTest : FixTestBase("test/paragraph3/long_line", ::LineLength)
fun `fix bin expression first symbol last word`() {
fixAndCompare("LongBinaryExpressionLastWordExpected.kt", "LongBinaryExpressionLastWordTest.kt", rulesConfigListErrorLineLength1)
}

@Test
fun `fix bin 1expression first symbol last word`() {
Copy link
Member

Choose a reason for hiding this comment

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

typo in test name

@Arrgentum Arrgentum self-assigned this Jul 4, 2022
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.

LongLine rule doesnt fix long complex expression
3 participants