This release introduces new features and is fully backward-compatible. It also adapts to changes in the R parser committed into R devel (#419).
style_text()
(print.vertical()
) now returns syntax-highlighted code by default, controllable via the option styler.colored_print.vertical
(#417).Thanks to all contributors for patches, issues and the like: @jonmcalder, @krlmlr, @IndrajeetPatil, @kalibera, @Hasnep, @kiranmaiganji, @dirkschumacher, @ClaytonJY, @wlandau, @maurolepore,
This is a maintenance release without any breaking API changes.
.Rmd
files are now respected and won’t get styled (#386).EQ_SUB
(=
) (#380).CONTRIBUTING.md
to outline guidelines for contributing to styler.Thanks to all contributors for patches, issues and the like: @katrinleinweber, @krlmlr, @dchiu911, @ramnathv, @aedobbyn, @Bio7, @tonytonov, @samhinshaw, @fny, @vnijs, @martin-mfg, @NGaffney, @dchiu911.
This is a maintenance release without any breaking API changes.
dplyr
dependency via purrr:::map_dfr()
(thanks @jimhester, #324).>= 0.2.3
) (#338).v1.4.2
so styler should run ~2x as fast (#348). For that reason, styler now depends on tibble >= 1.4.2
.enc
, a bug was fixed that removed/changed non-ASCII characters. Hence, styler now depends on enc >= 0.2
(#348).#*
, #306), shebang #/!
(#345), knitr chunk headers for spinning (#+
/ #-
, #362).tidyverse_style()
after !!
since with rlang 0.2
, !!
now binds tighter (#322), spacing around ~
(#316), no space anymore around ^
(#308).Thanks to all contributors for patches, issues and the like: @devSJR, @klrmlr, @yutannihilation, @samhinshaw, @martin-mfg, @jjramsey, @RMHogervorst, @wlandau, @llrs, @aaronrudkin, @crew102, @jkgrain, @jennybc, @joranE.
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)