Skip to content
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

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

Merged
merged 1 commit into from
Jan 19, 2025

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