pre-commit does not work when used in a project with R renv

search you tried in the issue tracker

r, renv

describe your issue

As of now, the environment variables $RENV_PROJECT and $R_PROFILE_USER are not unset during the installation process, so the hooks won't be properly installed in an R project that uses renv in an IDE like RStudio where these env variables were set already. During hook execution, the hook patch is already applied correctly.

This problem (with a reprex) was reported downstream.

I will go ahead and submit a PR to fix it, adapting the designated wrapper to call R should suffice. Hope it's ok to not provide a .pre-commit-config.yaml for this.

pre-commit --version

pre-commit 4.0.1

.pre-commit-config.yaml

~/.cache/pre-commit/pre-commit.log (if present)

No response