5 ms·
While I am a fan of auto-formatting, I do use it sometimes and don't think it is necessarily dumb in all cases (and so agree with your premise of making it a te
by saurik 5y ago
While I am a fan of auto-formatting, I do use it sometimes and don't think it is necessarily dumb in all cases (and so agree with your premise of making it a team decision)... but, doing it as a pre-commit hook--as opposed to doing it when your file gets saved and merely verifying it was done pre-commit--is extremely dangerous as it leads to these issues like "code is tested locally... and then something different is committed that should be the same, but might not be" and is the real problem being described.
- saurik 5y ago(OMG I somehow edited this sentence so many times I dropped a "not": I am not a fan of auto-formatting ;P.)
- slavik81 5y agoFor example, I recently spent several hours fixing a pre-commit hook that would apply clang-format to any file changed and then `git add` the file. Thus, the patch shown in `git commit --verbose` would be very misleading. It would show the original patch, not what was actually going to be committed. Due to the hook, any other changes that happened to be in the same file would be silently commited (even if they were never staged for commit).