README: "AST doesn't know about spaces" #8538
Replies: 3 comments 2 replies
-
Hi, thanks for the question. You're right 🙂 , it can be serious warning or not relevant at all, it depends on your codebase. We've had many opposite reactions, where people wanted all the spaced to remain the same, but technically it was not possible, so we added this warning to expect the edge-case issues (depending on your code base) and be prepated. |
Beta Was this translation helpful? Give feedback.
-
@mindplay-dk when no change on the target file, there is tweak on rector when comparing output from php-parser printer vs original file content: rector/src/Application/FileProcessor.php Lines 161 to 181 in 3e8c192 with php-parser v5, the printed content no longer |
Beta Was this translation helpful? Give feedback.
-
Converted to discussion, as it fits better 👍 |
Beta Was this translation helpful? Give feedback.
-
is this still pertinent?
rector/README.md
Line 152 in 3e8c192
according to this issue, most issues with spacing were long since resolved?
in my preliminary testing with Rector, I have not seen it mangle any spaces - and that's in a codebase with no code standard 🙂
I understand there may still be some issues with spacing, but I almost skipped Rector (and would have done all of my rename operations by hand in PHP Storm instead) because of this warning - and clearly, it goes have some level of awareness of spacing, or this project would most likely have been totally mangled. 😅
(glad I chose Rector, as this will save me a lot of time! thank you for this incredible tool!)
Beta Was this translation helpful? Give feedback.
All reactions