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

Fix conditional body wrapping inside single line string interpolation #1885

Conversation

mwaterfall
Copy link
Contributor

We experienced a problem with the wrapConditionalBodies rule, where it would break compilation if a conditional body is inside a single line string as part of string interpolation.

Screenshot 2024-09-20 at 15 02 10

I've fixed the issue and added test coverage. The fix is using the same check that was added to fix an almost identical problem with ternary operator wrapping.

Fixes "Cannot find ')' to match opening '(' in string interpolation" when line breaks are added in the middle of a single line string interpolation.
Copy link

codecov bot commented Sep 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.80%. Comparing base (5ed94a0) to head (0eaa618).
Report is 1 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1885      +/-   ##
===========================================
- Coverage    95.14%   94.80%   -0.34%     
===========================================
  Files          134      134              
  Lines        18985    18987       +2     
===========================================
- Hits         18063    18001      -62     
- Misses         922      986      +64     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@nicklockwood nicklockwood merged commit 0ad4558 into nicklockwood:develop Sep 22, 2024
11 of 12 checks passed
@nicklockwood
Copy link
Owner

Thank you!

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.

2 participants