Skip to content

check: set HOME to a tmp dir to avoid polluting the working dir#551

Merged
sandydoo merged 1 commit intomasterfrom
fix-src-pollution
Jan 19, 2025
Merged

check: set HOME to a tmp dir to avoid polluting the working dir#551
sandydoo merged 1 commit intomasterfrom
fix-src-pollution

Conversation

@sandydoo
Copy link
Member

@sandydoo sandydoo commented Jan 19, 2025

pre-commit creates cache files in $HOME/.cache/pre-commit. If $HOME is set to $PWD, we will pollute the working directory, causing hook failures.

Previously, we would copy the source files into a nested src directory. Now that Nix already provides the source files in the working directory for us, to avoid another copy, we set $HOME to a temporary directory.

pre-commit creates cache files in $HOME/.cache/pre-commit.
If $HOME is set to $PWD, we will pollute the working directory, causing
hook failures.

Previously, we would copy the source files into a nested `src` directory.
Now that Nix already provides the source files in the working directory
for us, to avoid another copy, we set $HOME to a temporary directory.
@sandydoo sandydoo added the bug Something isn't working label Jan 19, 2025
@sandydoo sandydoo merged commit 15a87ce into master Jan 19, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant