@@ -32,10 +32,10 @@ The goal of this package is to twofold:
3232
3333## Installation
3434
35- You can install the package from GitHub :
35+ You can install the package from CRAN :
3636
3737``` r
38- remotes :: install_github( " lorenzwalthert/ precommit" )
38+ install.packages( " precommit" )
3939```
4040
4141To access pre-commit functionality from R, you also need to install the
@@ -81,11 +81,13 @@ helper function `precommit::open_config()` let’s you open and edit the
8181` .pre-commit-config.yaml ` conveniently from the RStudio console. When
8282any file is changed due to running a hook or the hook script errors, the
8383commit will fail. You can inspect the changes introduced by the hook and
84- if satisfied, you can attempt to commit again. Note that while some
85- hooks change files (like the styler hook) so that they won’t fail when
86- you attempt to commit again, some (like the lintr hook) will need your
87- action before they pass at the next attempt. If all hooks pass, the
88- commit is made. You can also [ temporarily disable
84+ if satisfied, you can add the changes made by the hook to the index with
85+ ` git add path/to/file ` and attempt to commit again. Some hooks change
86+ files, like the styler hook, so all you need to do to make the hook pass
87+ is ` git add ` the changes introduced by the hook. Other hooks, like the
88+ parsable-R hook, will need your action, e.g. add a missing closing brace
89+ to a call like ` library(styler ` , before they pass at the next attempt.
90+ If all hooks pass, the commit is made. You can also [ temporarily disable
8991hooks] ( https://pre-commit.com/#temporarily-disabling-hooks ) . If you
9092succeed, it should look like this:
9193
@@ -115,9 +117,8 @@ To update the hook revisions, run `precommit::autoupdate()`.
115117 RStudio. Stashes are restored when you abort a `git commit` with
116118 ` INT` (e.g. Ctrl+C) on the command line. To restore stashes,
117119 manually after hitting *abort* in the RStudio git tab, you can `git
118- stash apply /path/to/patch_with_id` whereas you find the patch under
119- your pre-commit cache, which is usually under
120- ` $HOME/.cache/pre-commit/` .
120+ apply /path/to/patch_with_id` whereas you find the patch under your
121+ pre-commit cache, which is usually under `$HOME/.cache/pre-commit/`.
121122
122123 - Because R is not officially supported as a language in the
123124 pre-commit framework (yet), there is no R package dependency
@@ -134,9 +135,8 @@ To update the hook revisions, run `precommit::autoupdate()`.
134135In that case, just install the package with `install.packages()` once
135136and try to commit again. All R dependencies of the pre-commit hooks
136137provided in this repo are suggested dependencies of this R package, so
137- if you want to install them all, just
138- ` remotes::install_github("lorenzwalthert/precommit", dependencies =
139- c("Imports", "Suggests"))` .
138+ if you want to install them all, just `install.packages("precommit",
139+ dependencies = c("Imports", "Suggests"))`.
140140
141141# # Documentation
142142
0 commit comments