-
Notifications
You must be signed in to change notification settings - Fork 137
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
Uninstall pre-commit hooks when they are disabled #198
Comments
For this to work reliably, we'd need to mark that it was installed by pre-commit-hooks.nix |
This would be detectable if we customize the hook installation more. Nixpkgs already patches that code, but the gc root management isn't up to par yet. We may also want to move the config file from Currently it looks like #!/nix/store/znkypmyvykawwg71xawqzb98qbllijv8-bash-5.1-p16/bin/bash
# File generated by pre-commit: https://pre-commit.com
# ID: 138fd403232d2ddd5efb44317e38bf03
# start templated
INSTALL_PYTHON=/nix/store/9srs642k875z3qdk8glapjycncf2pa51-python3-3.10.7/bin/python3.10
ARGS=(hook-impl --config=.pre-commit-config.yaml --hook-type=pre-commit)
# end templated
HERE="$(cd "$(dirname "$0")" && pwd)"
ARGS+=(--hook-dir "$HERE" -- "$@")
exec /nix/store/5d25296lls7rvrqc62jxvcwsyg60q4ag-python3.10-pre-commit-2.20.0/bin/pre-commit "${ARGS[@]}" The last line only tells us that |
Sound good to me! |
In the shell code, if the user removed all hooks, uninstall the hook.
The text was updated successfully, but these errors were encountered: