Open hhstore opened 3 years ago
# 安装:
brew install pre-commit
curl https://pre-commit.com/install-local.py | python -
# 检查版本:
pre-commit --version
# 切换到项目根目录:
cd project-root/
# 项目中激活:
pre-commit install
.pre-commit-config.yaml
配置文件参考, 这个是 go 项目的. 直接拿走用.
配置好 git-pre-commit-hook 之后, 每次 git commit, 都会自动做 check, 如果check 不过, 无法提交代码.
commit check 不通过 提示 hook 插件, 帮你 fmt 了, 你要重新 commit 一次.
1
xxxxxxxxxxxxxx | xxxxxxxxxxxxxx | xxxx |
---|---|---|
xxxxxxxxxxxxxx | xxxxxxxxxxxxxxxxxx | xxxxxxxxxx |
xxxxxxxxxxxxxx | xxxxxxxxxxxxxxxxxx | xxxxxxxxxx |
xxxxxxxxxxxxxx | xxxxxxxxxxxxxxxxxx | xxxxxxxxxx |
xxxxxxxxxxxxxx | xxxxxxxxxxxxxxxxxx | xxxxxxxxxx |
xxxxxxxxxxxxxx | xxxxxxxxxxxxxxxxxx | xxxxxxxxxx |
xxxxxxxxxxxxxx | xxxxxxxxxxxxxxxxxx | xxxxxxxxxx |
xxxxxxxxxxxxxx | xxxxxxxxxxxxxxxxxx | xxxxxxxxxx |
related: