Open SaranjeetKaur opened 3 months ago
I just came on here to post this because I noticed the pre-commit CI app was failing. Bigger picture, it's my fault for enabling it for every repo on the org unconditionally, but if you're going to use pre-commit anyway then that'll also fix things :smile:
Do you think I should disable it for new repos @jamesturner246? I mean, we don't have many repos on here and most of them do use pre-commit, but...
Hi @alexdewar, I am planning to include pre-commit on this repo. I would have done that by now but I am running into some errors and will be catching up with James shortly today to work on it
Steps to autogenerate .pre-commit-config.yaml
in RStudio on Windows:
pip install pre-commit --user
(macOS, Linux and Windows) outside a conda or virtual environment. (Alternatively, test a work around with zipapp)precommit::path_precommit_exec()
precommit_path <- "C:/Users/ssbhogal/.pyenv/pyenv-win/versions/3.11.0/Scripts/pre-commit.exe" # path to the pre-commit executable
options(precommit.executable = precommit_path) # set R options
getOption("precommit.executable")
should return the path to the executable, if everything is ok. In this case, it will return "C:/Users/ssbhogal/.pyenv/pyenv-win/versions/3.11.0/Scripts/pre-commit.exe"
. The same output will also be returned if instead you use precommit::path_precommit_exec()
.precommit::use_precommit()
to autogenerate .pre-commit-config.yaml
If you are using the roxygenize hook, then this requires further edits in your .pre-commit-config.yaml
, please run precommit::snippet_generate('additional-deps-roxygenize')
to proceed with the same. It will generate the following snippet:
Generating snippet using CRAN versions. If you need another source, specify with syntax that `renv::install()` understands (see examples in help file).
- id: roxygenize
# roxygen requires loading pkg -> add dependencies from DESCRIPTION
additional_dependencies:
- ggplot2
- grDevices
• Replace the id: roxygenize
key in .pre-commit-config.yaml
with the
above code.
ℹ Note that CI services like vignette("ci", package = "precommit")
for details and solutions.
Ideally we will use it in all repos, eventually, but I'm not against changing it if it prevents issues.
lintr
and also set uppre-commit
yaml file..gitignore
templateREADME.Rmd
and convert it toREADME.md
before commiting