styler 1.3.2

Release upon request by the CRAN team.

Minor changes and fixes

styler 1.3.1

Emergency release. In case multiple expressions are on one line and only some of them are cached, styler can remove code. To reach this state, some of the expressions must have been styled previously alone and the cache must be active. Example:

library(styler)
cache_activate()
#> Using cache 1.3.0 at ~/.Rcache/styler/1.3.0.
style_text("1")
#> 1
style_text("1 # comment")
#> # comment

This is obviously detrimental. We have added additional tests and fixed the problem (#593, #595), but we want repeat the warning from ?style_file that all style APIs apart from style_text() overwrite code and that styler can only check the AST remains valid with scope < "tokens". So use this if you are conservative. Or deactivate the cache with deactivate_cache() until it has fully matured.

We thank the people who have contributed to this release:

@ellessenne and @renkun-ken.

styler 1.3.0

Breaking changes

New features

Minor changes and fixes

Thanks to all contributors involved, in particular @colearendt, @davidski, @IndrajeetPatil, @pat-s, and @programming-wizard.

styler 1.2.0

Breaking changes

New features

Minor improvements and fixes

Adaption

Thanks to all contributors involved, in particular

@Banana1530, @batpigandme, @cpsievert, @ellessenne, @Emiller88, @hadley, @IndrajeetPatil, @krlmlr, @lorenzwalthert, @lwjohnst86, @michaelquinn32, @mine-cetinkaya-rundel, @Moohan, @nxskok, @oliverbeagley, @pat-s, @reddy-ia, and @russHyde

styler 1.1.1

This is primarily a maintenance release upon the request of the CRAN team (#490).

Major changes

Minor changes

Adaption of styler

Since it’s never been mentioned in the release notes, we also mention here where else you can use styler functionality:

Thanks to all contributors involved, in particular @ArthurPERE, @hadley, @igordot, @IndrajeetPatil, @jackwasey, @jcrodriguez1989, @jennybc, @jonmcalder, @katrinleinweber, @krlmlr, @lorenzwalthert, @michaelquinn32, @msberends, @raynamharris, @riccardoporreca, @rjake, @Robinlovelace, @skirmer, @thalesmello, @tobiasgerstenberg, @tvatter, @wdearden, @wmayner, and @yech1990.

styler 1.1.0

This release introduces new features and is fully backward-compatible. It also adapts to changes in the R parser committed into R devel (#419).

Major Changes

Minor Changes

Thanks to all contributors for patches, issues and the like: @jonmcalder, @krlmlr, @IndrajeetPatil, @kalibera, @Hasnep, @kiranmaiganji, @dirkschumacher, @ClaytonJY, @wlandau, @maurolepore

styler 1.0.2

This is a maintenance release without any breaking API changes.

Major Changes

Minor Changes

Thanks to all contributors for patches, issues and the like: @katrinleinweber, @krlmlr, @dchiu911, @ramnathv, @aedobbyn, @Bio7, @tonytonov, @samhinshaw, @fny, @vnijs, @martin-mfg, @NGaffney, @dchiu911.

styler 1.0.1

This is a maintenance release without any breaking API changes.

Minor changes

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.

styler 1.0.0

Initial release.

stylers

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(...))

style guides

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())

style guide creators

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()
)

Helpers

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)