implemented the pre-commit hook