Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Split the reformatting and real change. Make the reformatting change first and have a policy of merging those change fast.


Some teammates agreed to do this, but it's not known what files will be edited ahead of time, so a large job often has formatting edits anyway.


Yeah, it's really something that you have to get buy-in for.

You could always make a commit that just has the reformatting when you do start editing a file. If it turns out you didn't need to edit that file after all, then you can revert just that commit easily. And if you did, you can collect up all the reformatting commits into a PR as a first step.

The flip side of this is making minimal surgical small changes, and then doing the refactoring after the change. The key message though is split them.

Refactoring doesn't change behavior, so refactoring efforts should be judged only on "tests exist that cover the functionality, those tests continue to pass, the code is easier to maintain". It's when you add "changed functionality, so we changed the test" to review at the same time, that this becomes a hassle.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: