-
-
Notifications
You must be signed in to change notification settings - Fork 804
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SKIP skips invocation by alias but doesn't skip "Installing environment" #2478
Comments
Additional info: we are very well aware of the caching setups (and quite much like it!) and in our CI builds we do cache everything whenever an The most painful use case is really when a developer wants to commit files which has nothing to do with one python project, but since the |
initialization must happen to resolve the alias -- but it shouldn't be installed -- please don't skip the prompts in the issue template. show the command you ran and the output |
Sorry, my vocabulary was confused. Initialization should happen yes. Installing the environment should not. Here is the output (with cleared ± SKIP=pylint-alias2 pre-commit run --all-files
[INFO] Initializing environment for https://github.com/PyCQA/pylint.
[INFO] Initializing environment for https://github.com/PyCQA/pylint:arrow.
[INFO] Initializing environment for https://github.com/PyCQA/pylint:hdfs.
[INFO] Installing environment for https://github.com/PyCQA/pylint.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/PyCQA/pylint.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
pylint-alias1........................................(no files to check)Skipped
pylint-alias2...........................................................Skipped |
yep seems like an oversight then, send a tested patch please |
search tried in the issue tracker
SKIP alias
describe your issue
When I run
the hook aliased as
pylint-alias2
is properly skipped, however, its environment is still initialized. I would expect that it also skips the lengthy initialization of the environment.Indeed, running a single hook (run.py#153) checks against
hook.id
andhook.alias
, howeverinstall_hook_envs
is invoked with only filtering againsthook.id
(run.py#423Is this inconsistency deliberate? I couldn't find a use case for it. This quick and dirty patch works for us:
In our use case Initialization is not needed for everyone (monorepo where some non-python devs also do non-python work) and also very expensive unfortunately (6minutes currently to install already cached pip packages)
(An even better solution would be if initialization wouldn't happen at all if the hook run would we skipped in general (because of
SKIP
variable or because there is no files changed, however, that would be a but bigger patch I suppose))pre-commit --version
pre-commit
.pre-commit-config.yaml
~/.cache/pre-commit/pre-commit.log (if present)
No response
The text was updated successfully, but these errors were encountered: