Made pre-commit hook more robust and prettyfied output.