style_box_use_text {box.linters}R Documentation

Style the box::use() calls of source code text

Description

Styles box::use() calls.

Usage

style_box_use_text(
  text,
  indent_spaces = 2,
  trailing_commas_func = FALSE,
  colored = getOption("styler.colored_print.vertical", default = FALSE),
  style = prettycode::default_style()
)

Arguments

text

Source code in text format

indent_spaces

Number of spaces per indent level

trailing_commas_func

A boolean to activate adding a trailing comma to the end of the lists of functions to attach.

colored

Boolean. For syntax highlighting using {prettycode}

style

A style from {prettycode}

Examples

code <- "box::use(stringr[str_trim, str_pad], dplyr)"

style_box_use_text(code)

code <- "box::use(stringr[
  str_trim,
  str_pad
],
shiny[...], # nolint
dplyr[alias = select, mutate], alias = tidyr
path/to/module)
"

style_box_use_text(code)

style_box_use_text(code, trailing_commas_func = TRUE)


[Package box.linters version 0.10.0 Index]