Ignore whitespace changes to functions#50
Conversation
Split function definitions by whitespace, and compare the lists of tokens for equality
|
I think this might be similar to #37. The approach here is probably too naive. A full tokenizer is probably required to be able to do this proper |
|
Yeah, the trouble with this is that if you have whitespace literals within your functions, this won't work correctly. I understand why this feature would be useful (I've wanted it myself many times), but I'm not aware of a way to do this without compromising on correctness. I think a better approach might be highlighting what has changed about a function via the addition of comments in the output. You could even show a text diff of the definition. I'm working on some structural changes to the codebase that will allow the addition of such comments easily, but it will take some time. |
|
Yeah I have a hacked in place ndiff also to help me out. I activate it with an env var so I didn’t have to make too many changes throughout |
13f62b5 to
ebbc2e4
Compare
Hi! Thanks for the great library and the migra tool.
I'm not sure this change is entirely fool proof, but I can't think of a case where whitespace has special meaning, unless the embedded language used is whitespace sensitive (such as Python itself).
At least it has been useful to me when formatting the body of functions for readability, but not making any functional changes beyond whitespace