【发布时间】:2021-02-27 22:35:08
【问题描述】:
我正在尝试在存储库中添加一个 gitlint 预提交挂钩。 .pre-commit-config.yaml 文件看起来像这样:
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: local
hooks:
- id: gitlint
name: gitlint
entry: gitlint
language: system
但是,我不断得到:
- hook id: gitlint
- exit code: 253
Usage: gitlint [OPTIONS] COMMAND [ARGS]...
Try 'gitlint --help' for help.
Error: No such command '.pre-commit-config.yaml'.
这是我跑完之后:
pip install gitlint
pre-commit install --hook-type commit-msg
我做错了什么?
【问题讨论】:
-
gitlint的安装方式和位置是什么? -
安装在 MacOS 上。使用 pip 安装 gitlint。我真的想通了。我必须在 .pre-commit.yaml 中添加
types: [python]。现在我有一个不同的问题。我会更新问题
标签: git pre-commit-hook pre-commit.com