17

我正在尝试pre-commit为 Python 项目的存储库进行设置。运行后,pre-commit install我看到这样的输出:

[INFO] Installing environment for https://github.com/asottile/seed-isort-config.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/pre-commit/mirrors-isort.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/pre-commit/pre-commit-hooks.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/pre-commit/mirrors-pylint.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...

这些“环境”是什么?它们安装在哪里?

4

2 回答 2

28

The environments are installed into a cache:

pre-commit by default places its repository store in ~/.cache/pre-commit -- this can be configured in two ways:

  • PRE_COMMIT_HOME: if set, pre-commit will use that location instead.
  • XDG_CACHE_HOME: if set, pre-commit will use $XDG_CACHE_HOME/pre-commit following the XDG Base Directory Specification.

disclaimer: I am the author

于 2020-06-23T16:32:21.363 回答
0

查看此文档部分:管理 CI 缓存

于 2020-06-23T16:34:35.440 回答