4 ms·
Having it as a git pre-commit hook seems dangerous to me — what if there's a bug in the formatting tool that breaks something in the code? Then you have non-fu
by JasonFruit 14y ago
Having it as a git pre-commit hook seems dangerous to me — what if there's a bug in the formatting tool that breaks something in the code? Then you have non-functioning code committed. It's a lot better if you can just have the self-discipline to run the formatter when you're done making changes. Alternatively, you could have it in your build script, so you'll likely catch the formatter-related problem when you're testing your code.
- myg204 14y agoor have it run every time you save a file
- wging 14y agoOr what about a pre-commit hook that, instead of transforming the version you're committing, just compares a transformed version to the version you're trying to commit? You could warn on commit if they don't match, plus maybe provide an option to override the warning and commit anyway.
- df3n5 14y agoI like this. If someone writes a version which does this let me know and I'll post a link on the post.
- deleted 14y ago[deleted]