5 ms·
In addition, if their code is python, -w would incorrectly ignore legitimate changes
by harikb 5y ago
In addition, if their code is python, -w would incorrectly ignore legitimate changes
- jrochkind1 5y agodo you have a realistic example?
- contravariant 5y agoA simple one would be: total = 0 for value in list: total += value return total vs. total = 0 for value in list: total += value return total
- jrochkind1 5y agoah, fixing a bug, ok. I was trying to think of two hypothetical correctly functioning programs identical but for whitespace, and thinking that was probably pretty rare.
- contravariant 5y agoWell the first one simply returns the first value of the list, which can be correct. I just gave the variables names that turned this into a bugfix.
- jrochkind1 5y agoI don't see any sane reason you'd intentionally access the first element only of a list by using a for loop with a non-conditional return. But anyway okeydoke. I do wonder if there are any realistic non-bugfix refactors/enhancements that would result in a whitespace-only change, or in general how often in a real codebase you are going to get a whitespace-only commit diff. But yeah, I understand it is possible, cool.