我正尝试在存储库中添加一个gitlint预提交钩子。The The The
文件看起来像这样:
# 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我做错了什么?
发布于 2021-03-01 00:31:34
由于以下几个原因,您的配置会中断:
您已配置
为所有人
,这意味着它将在您不想要的其他git钩子上运行(例如
等)。要解决此问题,您需要设置
您还缺少一些其他设置,例如正确的参数
等等。
此外,您还在使用
这意味着你依赖于你的贡献者来设置工具--这
错过了预提交的要点
是不受支持的逃生舱。拥有托管工具的通常方法是重用现有存储库(见下文)或使用
以托管方式安装工具
支持使用gitlint的方式来自存储库本身
repos:
- repo: https://github.com/jorisroovers/gitlint
rev: '' # pick a tag / sha to use
hooks:
- id: gitlint免责声明:我是pre-commit的创建者,并为gitlint贡献了pre-commit支持
发布于 2021-02-28 19:04:57
错误消息没有多大帮助。我只是缺少args和stage字段:
# 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
language: python
entry: gitlint
args: [--staged, --msg-filename]
stages: [commit-msg]https://stackoverflow.com/questions/66404081
复制相似问题