DEV Community

loading...

Discussion on: A simple pre-commit hook that saves you big time!

Collapse
rahul_ramfort profile image
Rahul Author

Agreed. That's the right way to do.

But I don't see any harm in having this either. Particularly for the "last-minute changes". Human errors are always possible, so why not put some checks.

To err is human; to automate, divine

Collapse
nombrekeff profile image
Keff

We use pre-commit hook at work to run tests before committing and we also run tests in GitHub actions on any PR to prevent human error. It's been working great for now.

The hook could also be used to lint commit messages if the company or project uses some automated changelog generator or some committing standard.

Thread Thread
rahul_ramfort profile image
Rahul Author

Thanks for adding this mate. I will make this hook, lint commit messages as well.