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
[](http://www.repostatus.org/#wip)
23
23
24
24
The goal of styler is to provide non-invasive pretty-printing of R source code
25
25
while adhering to the [tidyverse](https://github.com/tidyverse/style) formatting
26
26
rules. Support for custom style guides is planned.
27
27
28
-
You can style a simple character vector of code with `style_text()`, a directory
29
-
with `style_dir()`or a whole R package with `style_pkg()`.
28
+
You can style a simple character vector of code with `style_text()`:
30
29
```{r echo=FALSE, message=FALSE}
31
-
devtools::load_all()
30
+
pkgload::load_all()
31
+
library("magrittr")
32
32
#knitr::opts_chunk$set(comment = NA)
33
33
```
34
34
35
35
36
36
```{r}
37
37
ugly_code <- "a<-function( x){1+1} "
38
-
style_text(ugly_code)
38
+
style_text(ugly_code) %>%
39
+
cat(sep = "\n")
39
40
40
41
```
41
42
42
-
You can find more information on the wiki of [Google Summer of Code 2017](https://github.com/rstats-gsoc/gsoc2017/wiki/Noninvasive-source-code-formatting)
43
-
or check out the [pkgdown](https://krlmlr.github.io/styler/) page.
44
-
45
-
In the following, we present a dirty file and how it is styled with styler.
46
-
The file can either be tidied, which is a less strict form of styling with an
47
-
emphasis on preserving the programmer's intentions - or cleaned, which means to
You can find more information on the wiki of [Google Summer of Code 2017](https://github.com/rstats-gsoc/gsoc2017/wiki/Noninvasive-source-code-formatting)
57
+
or check out the [pkgdown](https://krlmlr.github.io/styler/) page.
0 commit comments