Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where does pre-commit install "environments"?

I'm trying to setup pre-commit for a Python project's repository. Upon running pre-commit install I see an output like this:

[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...

What are these "environments" and where are they being installed to?

like image 347
planetp Avatar asked Jun 23 '20 16:06

planetp


People also ask

Where are pre-commit hooks stored?

The hooks are all stored in the hooks subdirectory of the Git directory. In most projects, that's . git/hooks .

What is pre-commit terraform?

make a Terraform change, git add and git commit . pre-commit will regenerate your Terraform docs, after which you can rerun git add and git commit to commit the code and doc changes together.

How do I bypass pre-commit?

Use the --no-verify option to skip git commit hooks, e.g. git commit -m "commit message" --no-verify . When the --no-verify option is used, the pre-commit and commit-msg hooks are bypassed.


1 Answers

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

like image 128
Anthony Sottile Avatar answered Sep 23 '22 16:09

Anthony Sottile