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

Regression on empty lines in multiline strings not indented. #1700

Open
rafaelpedretti-toast opened this issue May 15, 2024 · 1 comment
Open

Comments

@rafaelpedretti-toast
Copy link

It seems that issue #1382 is happening again on version 0.53.9

Screen.Recording.2024-05-15.at.11.25.37.mov
@nicklockwood
Copy link
Owner

@rafaelpedretti-toast I don't think this is the same issue. The bug before was that when using --trimwhitespace nonblank-lines the indent rule could cause multiline string literals not to compile due to inconsistently indented white space.

But if I understand the issue in your video, it's that SwiftFormat is trimming leading whitespace from a blank line in a multiline string literal, which is by design, and doesn't cause any compilation problems as far as I know?

If you want to preserve that space you can use --trimwhitespace nonblank-lines. If you want to be able to preserve leading whitespace only for blank lines inside string literals, can you open a feature request? (but also, why?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants