Refactor how new lines after extends are inserted#109
Conversation
|
I forgot that I based this PR on the branch from my previous PR and I can't figure out how to rebase it onto main. Is there any way to rebase it or it will resolve itself when previous PR is merged ? |
|
You can just let me know when the work on this is done and I will take care of any issues that may arise, no worries. If this is close to completion, we can also simply directly merge this PR and close the other |
Have you tried |
It is ready, but I just was curious how to do a rebase when I already sent a PR.
Yes it gives me |
|
Does this PR depends on your other PR? If not, you can run |
This reverts commit 3850efe696cbe71eff4c96b2b497e2357c9e3d20.
ca0642d to
8b6917c
Compare
Thank you that helped, but I needed to do a force push to update a remote branch (or I didn't know how to do without a force push). Force pushes are always scary, I'll try to base my branches on the main in future :) |
I don't think it's possible without force |
|
@shadr Whenever you rewrite the history, like what Usually in teams where we use force pushes, we do it like this: If you know what you're doing it's okay, it's relatively safe: git also keeps a history of changes you make to the history, the reference log, and in many cases you can undo a change like this. You can undo a git rebase and then force push again. |
|
Great work, thank you! |
|
@NathanLovato thank you for the explanation! |
This PR refactors how new line character is inserted after extends statement and moves logic from topiary query to the regex postprocess step. (close #99)
I wanted to close #99, but then I realized that we basically need to undo some of the topiary query logic, so I refactored how it works.
I changed previous preprocess step into a postprocessing one, modified regex and made
regex_replace_all_outside_stringsacceptReplacerinstead of only&strto conditionally insert new line character only if it doesn't land on the EOF.