Skip to content

Commit 409a7fa

Browse files
README overwhaul
1 parent 9777bc3 commit 409a7fa

File tree

2 files changed

+25
-23
lines changed

2 files changed

+25
-23
lines changed

README.Rmd

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ The goal of this package is to twofold:
4141

4242
## Installation
4343

44-
You can install the package from GitHub:
44+
You can install the package from CRAN:
4545

4646
```{r}
47-
remotes::install_github("lorenzwalthert/precommit")
47+
install.packages("precommit")
4848
```
4949

5050
To access pre-commit functionality from R, you also need to install the
@@ -89,12 +89,14 @@ function `precommit::open_config()` let's you open and edit the
8989
`.pre-commit-config.yaml` conveniently from the RStudio console. When any file
9090
is changed due to running a hook or the hook script errors, the commit will
9191
fail. You can inspect the changes introduced by the hook and if satisfied, you
92-
can attempt to commit again. Note that while some hooks change files (like the
93-
styler hook) so that they won't fail when you attempt to commit again, some
94-
(like the lintr hook) will need your action before they pass at the next
95-
attempt. If all hooks pass, the commit is made. You can also [temporarily
96-
disable hooks](https://pre-commit.com/#temporarily-disabling-hooks). If you
97-
succeed, it should look like this:
92+
can add the changes made by the hook to the index with `git add path/to/file`
93+
and attempt to commit again. Some hooks change files, like the styler hook, so
94+
all you need to do to make the hook pass is `git add` the changes
95+
introduced by the hook. Other hooks, like the parsable-R hook, will need
96+
your action, e.g. add a missing closing brace to a call like `library(styler`,
97+
before they pass at the next attempt. If all hooks pass, the commit is made. You
98+
can also [temporarily disable hooks](https://pre-commit.com/#temporarily-disabling-hooks).
99+
If you succeed, it should look like this:
98100

99101
```{r, echo = FALSE, eval = TRUE}
100102
knitr::include_graphics("man/figures/screenshot.png")
@@ -122,7 +124,7 @@ To update the hook revisions, run `precommit::autoupdate()`.
122124
that in the future, the changes will be recovered in RStudio too. Note that
123125
this is only an issue with RStudio. Stashes are restored when you abort a `git
124126
commit` with `INT` (e.g. Ctrl+C) on the command line. To restore stashes,
125-
manually after hitting *abort* in the RStudio git tab, you can `git stash
127+
manually after hitting *abort* in the RStudio git tab, you can `git
126128
apply /path/to/patch_with_id` whereas you find the patch under your pre-commit
127129
cache, which is usually under `$HOME/.cache/pre-commit/`.
128130

@@ -138,7 +140,7 @@ To update the hook revisions, run `precommit::autoupdate()`.
138140
try to commit again.
139141
All R dependencies of the pre-commit hooks provided in this repo are suggested
140142
dependencies of this R package, so if you want to install them all, just
141-
`remotes::install_github("lorenzwalthert/precommit", dependencies = c("Imports", "Suggests"))`.
143+
`install.packages("precommit", dependencies = c("Imports", "Suggests"))`.
142144

143145
## Documentation
144146

README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -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

4141
To 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
8282
any file is changed due to running a hook or the hook script errors, the
8383
commit 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
8991
hooks](https://pre-commit.com/#temporarily-disabling-hooks). If you
9092
succeed, 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()`.
134135
In that case, just install the package with `install.packages()` once
135136
and try to commit again. All R dependencies of the pre-commit hooks
136137
provided 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

Comments
 (0)