News for hackers. Stuff that matters.
Re:Facts every web dev should know before they burn out and ... by saurik on Thursday October 21, 2021 @02:55AM (#28941243)
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.
Re:Facts every web dev should know before they burn out and ... by slavik81 on Thursday October 21, 2021 @03:05AM (#28941310)
For 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).

Re:Facts every web dev should know before they burn out and ... by saurik on Thursday October 21, 2021 @08:11AM (#28943276)
(OMG I somehow edited this sentence so many times I dropped a "not": I am not a fan of auto-formatting ;P.)