为我的存储库设置 Talisman 时提交更改时出现意外错误

Unexpected Error on committing changes when Talisman is setup for my repository

我为我的项目存储库设置了 Talisman,现在我无法将更改提交到分支。它因以下错误而中止。请帮忙!

[INFO] Installing environment for https://github.com/thoughtworks/talisman.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
An unexpected error has occurred: CalledProcessError: command: ('go', 'get', './...')
return code: 1
expected return code: 0
stdout:
    Executable `go` not found
stderr: (none)

无论出于何种原因,从源

安装时,talisman 错误地安装为名为 cmd 而不是 talisman 的可执行文件

我建议发送拉取请求以更正此代码 here 以使用 entry: cmd --githook pre-commit(以及该文件中的以下内容)

解决方法是直接在您的配置中覆盖不正确的值:

repos:
-   repo: https://github.com/thoughtworks/talisman
    rev: v1.22.0
    hooks:
    -   id: talisman-commit
        entry: cmd --githook pre-commit

这似乎在某个时候倒退了,也许是在他们的代码重构/重组期间——可能在 this commit


免责声明:我创建了预提交