Skip to content

Fix disable:next handling in multiline strings - #2646

Open
EhsanAzish80 wants to merge 1 commit into
nicklockwood:developfrom
EhsanAzish80:fix-disable-next-multiline-string
Open

Fix disable:next handling in multiline strings#2646
EhsanAzish80 wants to merge 1 commit into
nicklockwood:developfrom
EhsanAzish80:fix-disable-next-multiline-string

Conversation

@EhsanAzish80

@EhsanAzish80 EhsanAzish80 commented Aug 13, 2026

Copy link
Copy Markdown

Fixes #2645.

disable:next was consumed by the first physical line break inside a multiline string, allowing disabled rules such as wrap to run on the remaining string contents.

This change evaluates rule enablement within multiline strings from the opening delimiter, including content inside string interpolation scopes. The directive therefore applies to the entire multiline string while formatting resumes normally afterward.

Added focused regression coverage that reproduces the unwanted wrapping and verifies formatting resumes after the string.

Testing:

  • Full test suite: 5,930 tests passed with zero failures
  • Changed files pass SwiftFormat lint

@codecov

codecov Bot commented Aug 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.45%. Comparing base (dac0c06) to head (3a3eb51).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #2646   +/-   ##
========================================
  Coverage    95.44%   95.45%           
========================================
  Files          177      177           
  Lines        27073    27080    +7     
========================================
+ Hits         25841    25848    +7     
  Misses        1232     1232           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant