gpt4 book ai didi

python - 如何忽略预提交配置中的 `rev`?

转载 作者:行者123 更新时间:2023-12-03 07:56:32 29 4
gpt4 key购买 nike

这是来自 pre-commit.pre-commit-config.yaml .
它将 git 克隆 git 存储库的指定 rev
我怎样才能忽略 rev 并始终 git clone 最新的?

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace

最佳答案

你故意不能

来自the docs

pre-commit configuration aims to give a repeatable and fast experience and therefore intentionally doesn't provide facilities for "unpinned latest version" for hook repositories.

Instead, pre-commit provides tools to make it easy to upgrade to the latest versions with pre-commit autoupdate. If you need the absolute latest version of a hook (instead of the latest tagged version), pass the --bleeding-edge parameter to autoupdate.

pre-commit assumes that the value of rev is an immutable ref (such as a tag or SHA) and will cache based on that. Using a branch name (or HEAD) for the value of rev is not supported and will only represent the state of that mutable ref at the time of hook installation (and will NOT update automatically).


免责声明:我写了预提交

关于python - 如何忽略预提交配置中的 `rev`?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/75920424/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com