diff --git a/tests/git-hooks-no-python-leak/devenv.nix b/tests/git-hooks-no-python-leak/devenv.nix new file mode 100644 index 000000000..4d0fb8ab7 --- /dev/null +++ b/tests/git-hooks-no-python-leak/devenv.nix @@ -0,0 +1,12 @@ +# Assert that the pre-commit package does not leak its dependencies into the environment. +{ + git-hooks.hooks.nixfmt-rfc-style.enable = true; + + enterTest = '' + if [ -n "$PYTHONPATH" ]; then + echo "PYTHONPATH is non-empty: $PYTHONPATH" >&2 + echo "The pre-commit package is leaking its dependencies into the environment." >&2 + exit 1 + fi + ''; +}