Hacker News new | ask | show | jobs
by hu3 942 days ago
Worst offender is when a dev decides to reformat code and you can't even differentiate at a glance what is real code change and what is reformatting.

Fortunately modern tooling formats code automatically so there's less bikeshedding.

2 comments

There are some tools that can separate actual code changes from reformatting changes. I am working on https://semanticdiff.com, a VS Code Extension / GitHub App that can help you with this. There is also difftastic if you prefer a CLI based solution. It supports more languages but can detect fewer types of reformatting changes.
I like this idea of advancing beyond line-based diffs into something more meaningful. If someone renames a variable/type/module/whatever which changes X lines of code across Y files, I really don't care to see all of that, for what I'm concerned with that's a single diff.

(Assuming the code is in a language with a good type system and without reflection, I'm confident in automatic refactors and don't need to spend time on them in code review)

Just set to ignore whitespace in the review diff.