You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use {precommit} with my project, but I'm experiencing the below error:
> git commit -m "update R script"
style-files.............................................................. Failed
- hook id: style-files
- exit code: 1
- One or more packages recorded in the lockfile are not installed.
- Use `renv::status()` for more details.
- One or more packages recorded in the lockfile are not installed.
- Use `renv::status()` for more details.
Error in packageVersion("precommit") :
there is no package called ‘precommit’
Execution halted
I have already installed ran the following within my project:
renv::install("precommit")
# The following package(s) will be installed:# - precommit [0.4.3]# These packages will be installed into "~/Projects/test-pre-commit-styler/renv/library/R-4.1/x86_64-pc-linux-gnu".## Do you want to proceed? [Y/n]: y## # Installing packages -------------------------------# - Installing precommit ... OK [linked from cache]# Successfully installed 1 package in 26 milliseconds.renv::status()
# No issues found -- the project is in a consistent state.precommit::version_precommit()
# [1] "3.4.0"
packageVersion("precommit")
# [1] ‘0.4.3’precommit::autoupdate()
# ✔ Ran `pre-commit autoupdate ()` to get the latest version of the hooks.
However, {precommit} isn't tracked anywhere within my renv.lock file:
Updating one of my R scripts to include a call to {precommit} is a workaround to force {renv} to record its usage in the renv.lock, but this feels like a hack, and it unfortunately yields the same error about precommit not being recorded in the lockfile...
I'm hoping to better understand how to get {renv} to recognize that I'm using {precommit} with my project, regardless if its namespace is references within any R scripts, and to resolve this loadNamespace(x) : there is no package called 'precommit' error... Any insight is appreciated!
The text was updated successfully, but these errors were encountered:
philiporlando
changed the title
{renv} fails to record {precommit} in renv.lock
{renv} fails to record {precommit} in renv.lock and raises there is no package called 'precommit' error
Sep 16, 2024
I'm trying to use {precommit} with my project, but I'm experiencing the below error:
I have already installed ran the following within my project:
However, {precommit} isn't tracked anywhere within my
renv.lock
file:Updating one of my R scripts to include a call to {precommit} is a workaround to force {renv} to record its usage in the
renv.lock
, but this feels like a hack, and it unfortunately yields the same error about precommit not being recorded in the lockfile...I'm hoping to better understand how to get {renv} to recognize that I'm using {precommit} with my project, regardless if its namespace is references within any R scripts, and to resolve this
loadNamespace(x) : there is no package called 'precommit'
error... Any insight is appreciated!Here is a reprex.
The text was updated successfully, but these errors were encountered: