style_text_without_curly_curly: 'style_text()' without rules for \{\{

View source: R/testing-mocks.R

style_text_without_curly_curlyR Documentation

style_text() without rules for ⁠\{\{⁠

Description

This function mocks style_text(), but without taking into consideration the rules for the curly-curly syntactic sugar (introduced in rlang 0.4). This function (style_text_without_curly_curly()) is needed for testing only, namely to test indention with multiple curly braces in a sequence. It is important to maintain testing for indention rules even as the curly-curly expression is always kept on the same line in the tidyverse style guide because we should ensure the underlying mechanics for indention work correctly. When indention mechanisms are changed later, e.g. by simplifying compute_indent_indices(), we must have a way of testing this without the interaction of ⁠\{\{⁠.

Usage

style_text_without_curly_curly(
  text,
  ...,
  style = tidyverse_style,
  transformers = style(...),
  include_roxygen_examples = TRUE
)

See Also

set_line_break_around_curly_curly

Examples

styler:::style_text_without_curly_curly("rlang::list2({{ x }} := 2L)")
styler:::style_text("rlang::list2({{ x }} := 3)")

styler documentation built on Aug. 29, 2023, 5:10 p.m.