From 3e7e0ca773a050d99e2ede371cc14b2019a28941 Mon Sep 17 00:00:00 2001 From: lorenzwalthert <10477073+lorenzwalthert@users.noreply.github.com> Date: Mon, 30 Sep 2024 07:11:08 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20r-lib/st?= =?UTF-8?q?yler@08d11e1db2ccc0d874da414aa1f0a300e2928f97=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dev/CONTRIBUTING.html | 4 ++-- dev/articles/customizing_styler.html | 6 +++--- dev/articles/remove_rules.html | 2 +- dev/articles/third-party-integrations.html | 4 ++-- dev/index.html | 2 +- dev/news/index.html | 4 ++-- dev/pkgdown.yml | 2 +- dev/reference/caching.html | 2 +- dev/reference/style_file.html | 10 +++++----- dev/search.json | 2 +- 10 files changed, 19 insertions(+), 19 deletions(-) diff --git a/dev/CONTRIBUTING.html b/dev/CONTRIBUTING.html index af4179c6e..160de42a2 100644 --- a/dev/CONTRIBUTING.html +++ b/dev/CONTRIBUTING.html @@ -69,12 +69,12 @@
Read the vignettes. If you are done, come back here.
-devtools::load_all()
+devtools::load_all()
debug(style_text)
style_text("call(1, 2 + 1)")
Go broad before you go deep. Before going into the very deep layers of function calls of style_text()
, try to understand that style_text()
consists of a few function calls only. Go into each of them and try to understand one layer deep. That is, try to understand what make_transformer()
does by reading the names of the functions that get called, the name of the objects that are created by assigning the output of these function calls. Before looking into a functions source code, look at the documentation for that function. All internal important functions are documented and documentation is available also for unexported objects via ?
(if you did devtools::load_all()
). Then, go into parse_transform_serialize()
, and so on.
Go broad before you go deep. Before going into the very deep layers of function calls of style_text()
, try to understand that style_text()
consists of a few function calls only. Go into each of them and try to understand one layer deep. That is, try to understand what make_transformer()
does by reading the names of the functions that get called, the name of the objects that are created by assigning the output of these function calls. Before looking into a functions source code, look at the documentation for that function. All internal important functions are documented and documentation is available also for unexported objects via ?
(if you did devtools::load_all()
). Then, go into parse_transform_serialize()
, and so on.
To understand the most fundamental operation in styler, the manipulation of the columns related to spacing and line break information, pick a rule from R/rules-*.R
(e.g. R/rules-spacing
), add a break point to a rule, and style a string where you think this rule will be active. Then, see what happens and how this rule is applied on each level of nesting.
As the name says, this function removes spaces after the opening parenthesis. But how? Its input is a nest. Since the visitor @@ -331,7 +331,7 @@
This means that the order of the styling is clearly defined and it is for example not possible to modify line breaks based on spacing, because @@ -469,7 +469,7 @@
With our example function
set_line_break_before_curly_opening()
we don’t need to
diff --git a/dev/articles/remove_rules.html b/dev/articles/remove_rules.html
index 498ba8575..e0d619b53 100644
--- a/dev/articles/remove_rules.html
+++ b/dev/articles/remove_rules.html
@@ -220,7 +220,7 @@
Next, you simply set that element to NULL
.
diff --git a/dev/articles/third-party-integrations.html b/dev/articles/third-party-integrations.html index 942240d16..070f4ac48 100644 --- a/dev/articles/third-party-integrations.html +++ b/dev/articles/third-party-integrations.html @@ -96,7 +96,7 @@
as a pre-commit hook style-files
in https://github.com/lorenzwalthert/precommit to format
before commit (locally) and enforced as a continuous integration step in
the cloud through https://pre-commit.ci.
via usethis::use_tidy_style()
styles your project
+
via usethis::use_tidy_style()
styles your project
according to the tidyverse style guide.
through commenting a PR on GitHub with \style
when
the GitHub Action Tidyverse
@@ -119,7 +119,7 @@
reprex code before printing. To permanently use
style = TRUE
without specifying it every time, you can add
the following line to your .Rprofile
(via
-usethis::edit_r_profile()
):
+usethis::edit_r_profile()
):
options(reprex.styler = TRUE)
.
in the format-all command for Emacs in emacs-format-all-the-code.
As a Jupyterlab
diff --git a/dev/index.html b/dev/index.html
index 262376df8..1c2123d77 100644
--- a/dev/index.html
+++ b/dev/index.html
@@ -107,7 +107,7 @@ Installation
# install.packages("remotes")
-remotes::install_github("r-lib/styler")
Since it’s never been mentioned in the release notes, we also mention here where else you can use styler functionality:
-usethis::use_tidy_style()
styles your project according to the tidyverse style guide.
reprex::reprex(style = TRUE)
to prettify reprex code before printing. To permanently use style = TRUE
without specifying it every time, you can add the following line to your .Rprofile
(via usethis::edit_r_profile()
): options(reprex.styler = TRUE)
.
usethis::use_tidy_style()
styles your project according to the tidyverse style guide.
reprex::reprex(style = TRUE)
to prettify reprex code before printing. To permanently use style = TRUE
without specifying it every time, you can add the following line to your .Rprofile
(via usethis::edit_r_profile()
): options(reprex.styler = TRUE)
.
you can pretty-print your R code in RMarkdown reports without having styler modifying the source. This feature is implemented as a code chunk option in knitr. use tidy = "styler"
in the header of a code chunks (e.g. ```{r name-of-the-chunk, tidy = "styler"}
), or knitr::opts_chunk$set(tidy = "styler")
at the top of your RMarkdown script.
pretty-printing of drake workflow data frames with drake::drake_plan_source()
.
Adding styler as a fixer to the ale Plug-in for VIM.
If you are happy with the cache being cleared after 6 days, you can confirm the default and
silence this message by setting it instead to options(styler.cache_root = "styler")
.
You can make this change in your .Rprofile
using usethis::edit_r_profile()
.
You can make this change in your .Rprofile
using usethis::edit_r_profile()
.