add pre-commit configuration
fix displaying the error message when GPG verification failed, fix #3125