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

Remove trailing whitespace on first line of multiline string. #1236

Merged
merged 5 commits into from
Oct 19, 2023
Merged

Conversation

lrhn
Copy link
Member

@lrhn lrhn commented Jun 21, 2023

Proof-of-concept removal of non-participating trailing space and backslashes from the first line of multiline strings.

Slightly dangerous, becuase it had to tweak the "changes only whitespace" checking to allow removing backslashes (only precedeing a whitespace). That could allow removing the backslash in a raw string literal like r"\ " without being noticed.
(I know a current experiment also allows removing commas, so maybe it's easier to integrate into that experiment, if it has already generalized the "check whitespace only changes" test.)

@lrhn lrhn requested a review from munificent June 21, 2023 12:47
Copy link
Member

@munificent munificent left a comment

Choose a reason for hiding this comment

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

Thanks for doing this! I like cleaning up the leading whitespace, but not normalizing escapes. Assuming you're OK with removing the code for cleaning up the escapes, LGTM after that.

test/whitespace/strings.stmt Outdated Show resolved Hide resolved
lib/src/string_compare.dart Outdated Show resolved Hide resolved
@munificent
Copy link
Member

Oh, one more thing. Before merging this, please add an entry describing the change to the CHANGELOG. Thanks!

@lrhn
Copy link
Member Author

lrhn commented Jul 18, 2023

PTAL (did some significant changes to behavior, so another look is probably warranted.)

@lrhn
Copy link
Member Author

lrhn commented Oct 19, 2023

Merged to head, updated changelog to be at next version. Tests still succeed, so landing.

@lrhn lrhn merged commit a528dc5 into main Oct 19, 2023
8 checks passed
@lrhn lrhn deleted the fix-mls-ls branch October 19, 2023 15:06
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