Skip to content

Commit 850cc73

Browse files
reference pre-commit-hooks
1 parent d421812 commit 850cc73

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

NEWS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@
2626
* style file Addin can now properly handle cancelling (#511).
2727
* advice for contributors in `CONTRIBUTING.md` was updated (#508).
2828

29+
## Adaption
30+
31+
* styler is now available through the pre-commit hook `style-files` in
32+
https://github.com/lorenzwalthert/pre-commit-hooks.
2933

3034
# styler 1.1.1
3135

README.Rmd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ styler functionality is made available through other packages, most notably
127127
knitr. use `tidy = "styler"` in the header of a code chunks (e.g. ` ```{r
128128
name-of-the-chunk, tidy = "styler"}`), or `knitr::opts_chunk$set(tidy =
129129
"styler")` at the top of your RMarkdown script.
130+
* as a pre-commit hook `style-files` in
131+
https://github.com/lorenzwalthert/pre-commit-hooks.
130132
* pretty-printing of [drake](https://github.com/ropensci/drake) workflow data
131133
frames with `drake::drake_plan_source()`.
132134
* Adding styler as a fixer to the

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ customized to format code according to other style guides too.
2222
You can install the package from CRAN:
2323

2424
``` r
25-
install.packages("styler")
25+
install.packages("styler")
2626
```
2727

2828
Or get the development version from GitHub:
2929

3030
``` r
31-
# install.packages("remotes")
32-
remotes::install_github("r-lib/styler")
31+
# install.packages("remotes")
32+
remotes::install_github("r-lib/styler")
3333
```
3434

3535
## API
@@ -90,11 +90,11 @@ If you wish to keep alignment as is, you can use `strict = FALSE`:
9090
``` r
9191
style_text(
9292
c(
93-
"first <- 4",
93+
"first <- 4",
9494
"second <- 1+1"
9595
),
96-
strict = FALSE
97-
)
96+
strict = FALSE
97+
)
9898
#> first <- 4
9999
#> second <- 1 + 1
100100
```
@@ -123,6 +123,8 @@ notably
123123
chunks (e.g. ` ```{r name-of-the-chunk, tidy = "styler"}`), or
124124
`knitr::opts_chunk$set(tidy = "styler")` at the top of your
125125
RMarkdown script.
126+
- as a pre-commit hook `style-files` in
127+
<https://github.com/lorenzwalthert/pre-commit-hooks>.
126128
- pretty-printing of [drake](https://github.com/ropensci/drake)
127129
workflow data frames with `drake::drake_plan_source()`.
128130
- Adding styler as a fixer to the [ale

0 commit comments

Comments
 (0)