clang-format maybe to avoid discussions and ambiguities?. Its so far the only automagic tool that I've not become to hate. The earlier the better so history may be preserved. As close to the authors currently written code as possible. The fewer lines it changes, the better.