Implement safe mode for reorder code#165
Merged
NathanLovato merged 2 commits intomainfrom Nov 9, 2025
Merged
Conversation
Contributor
|
I tested this a bit with some of my code and seems to work fine. Code looks fine to me as well. The only issue I found is that inline comments are moved to a new line after reordering: Before: var test = 1 # CommentAfter: var test = 1
# CommentSafe mode didn't catch this, I guess because the syntax tree is the same in both cases. |
Contributor
Author
|
Thank you very much for taking the time to test and review the code! I'll try to address the issue a little later or otherwise log it |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This branch attempts to implement #76 and allow reorder-code to have support for safe mode.
I'm opening this PR in case someone has the time and will to review it before this gets into the formatter for wider testing.
The idea is now the formatter passes work like this:
Close #76