Initial release.
These are functions used to style code. They style a directory, a whole package, a file or a string.
style_dir(path = ".",
..., style = tidyverse_style, transformers = style(...),
filetype = "R", recursive = TRUE, exclude_files = NULL
)
style_pkg(pkg = ".",
..., style = tidyverse_style, transformers = style(...), filetype = "R",
exclude_files = "R/RcppExports.R"
)
style_file(path,
..., style = tidyverse_style, transformers = style(...)
)
style_text(text, ..., style = tidyverse_style, transformers = style(...))
These functions are the style guides implemented.
tidyverse_style(
scope = "tokens",
strict = TRUE,
indent_by = 2,
start_comments_with_one_space = FALSE,
reindention = tidyverse_reindention(),
math_token_spacing = tidyverse_math_token_spacing()
)
tidyverse_reindention()
tidyverse_math_token_spacing())
This function is used to create a style guide.
create_style_guide(
initialize = default_style_guide_attributes,
line_break = NULL,
space = NULL,
token = NULL,
indention = NULL,
use_raw_indention = FALSE,
reindention = tidyverse_reindention()
)
These are helper functions used to specify the style guides in use.
specify_math_token_spacing(
zero = NULL,
one = c("'+'", "'-'", "'*'", "'/'", "'^'")
)
specify_reindention(
regex_pattern = NULL,
indention = 0,
comments_only = TRUE
)
initialize_default_attributes(pd_flat)