Skip to content

Don't apply pre/postprocessing inside strings#80

Merged
NathanLovato merged 5 commits intoGDQuest:mainfrom
shadr:fix-postprocessing
Sep 25, 2025
Merged

Don't apply pre/postprocessing inside strings#80
NathanLovato merged 5 commits intoGDQuest:mainfrom
shadr:fix-postprocessing

Conversation

@shadr
Copy link
Copy Markdown
Contributor

@shadr shadr commented Sep 25, 2025

This PR fixes #79.

I'm not sure about clean_up_lines_with_only_whitespace. Tests passes without it, we can remove it entirely to allow trailing whitespace in multiline strings or we can left it as it is to remove trailing whitespaces from strings.

I'm also not sure about naming of the new functions.

Comment thread src/formatter.rs Outdated
Comment thread src/formatter.rs Outdated
@NathanLovato
Copy link
Copy Markdown
Contributor

Great, thank you! The cleaning function was to do a pass of whitespace cleanup I think, but for sure it should not happen in strings ideally. It can be removed for now if nobody feels a strong need for it - many code editors do or can do that for you on save. This said it can optionally be kept.

@shadr
Copy link
Copy Markdown
Contributor Author

shadr commented Sep 25, 2025

I added it in 78c34a3 and IIRC to fix a trailing whitespace after delimiter was inserted, but now that we handle vertical spacing outside of topiary I think we can remove that function to allow trailing whitepspaces in multiline strings.

@NathanLovato
Copy link
Copy Markdown
Contributor

Sounds good to me.

@shadr shadr marked this pull request as ready for review September 25, 2025 16:37
@shadr
Copy link
Copy Markdown
Contributor Author

shadr commented Sep 25, 2025

Other than the name for test files (I can't come up with a name that doesn't take a whole screen), I think it is good to go.

@NathanLovato NathanLovato merged commit 563ddcc into GDQuest:main Sep 25, 2025
@NathanLovato
Copy link
Copy Markdown
Contributor

Thank you!

@shadr shadr deleted the fix-postprocessing branch September 29, 2025 14:18
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.

fix_dangling_commas removes new lines from multiline strings

3 participants