git 项目本地钩子,在commit前提交执行脚本 https://github.com/pre-commit/pre-commit
天问 801164bd20 Add '.pre-commit-config.yaml' | 8 months ago | |
---|---|---|
.pre-commit-config.yaml | 8 months ago | |
README.md | 9 months ago |
git 项目本地钩子,在commit前提交执行脚本,比如自动测试,自动格式化,默认有多种编程语言模板。
pip install pre-commit
pre-commit --version
# 生成配置文件
pre-commit sample-config
vim .pre-commit-config.yaml
pre-commit install # 安装git钩子,.git/hooks/pre-commit
pre-commit run --all-files
pre-commit autoupdate