The same applies to refactoring. It seems perfectly doable for a code review tool to detect code motion, and have differet treatment of the code that moved unchanged vs. the parts that were modified.
The same applies to refactoring. It seems perfectly doable for a code review tool to detect code motion, and have differet treatment of the code that moved unchanged vs. the parts that were modified.
The simplest and clearest solution is to split out the changes in separate commits.
document.addEventListener('keydown', e => { console.log(e) });
and convert it to this, which changes both whitespace and syntax: document.addEventListener("keydown", (e) => {
console.log(e);
});
I don't think there are any diff tools that can hide the differences there, even though they're superficial.Personally, I wouldn't want a niche diff tool globally wrapping my diff views. I'd worry too much about missing something important.
And I agree that it's also a tough sell to get your teammates to all use this one particular diff tool.
For example git-blame can ignore whitespace, detect code movement inside a file, and even code movement across files. There's no reason why that has to be the limit of how smart blame can be.
I need to be able to see the intent and minimal definition of a change. Anything that obscures that is obnoxious not just to the reviewer but everyone after who might have to merge or understand the change. Perhaps it is because I manage code that is "high risk" and hence "I can't understand your change" equates to "it can't go into production" makes a difference.
Apart from that, it also ruins the chance to cherry pick / separately merge parts of the change.
To me this is pure laziness and selfishness and lack of discipline on the developers part.
The opposite problem is also a tooling problem: Why is it hard to save your changes to code, but not the formatting.