Run clang-format on the stage instead of the working dir
This has two effects: a) It's way faster because only the staged files are checked. b) More importantly, it prevents you from committing wrongly formatted code that you have clang-formatted in the working directory after the commit hook complained but that you forgot to stage after fixing the formatting.
Please register or sign in to comment