styler 1.10.3

This release was requested by the CRAN team since parser error messages changed, which were hard-coded in some unit tests (#1180).

Minor changes

CI

Testing

We thank everyone who helped making this release possible.

@AshesITR, @averissimo, @IndrajeetPatil, @lorenzwalthert, @mcanouil, @moodymudskipper, @olivroy, @sbanville-delfi, @sorhawell, @ssh352, @swo, and @vertesy.

styler 1.10.2

This release was requested by the CRAN team to fix CRAN warning on invalid numeric version inputs (#1143).

Minor changes

We thank everyone who helped making this release possible.

@krlmlr, @lorenzwalthert, @MichaelChirico, @olivroy, @rkrug, and @rossdrucker.

styler 1.10.1

This release was requested by CRAN due to accidentally populating a user cache while building vignettes for R >= 4.3.0.

Thanks to everyone who contributed to this release: @olivroy and @krlmlr.

styler 1.10.0

This release contains speed-ups between 20% and 40% depending on your use case thanks to replacing {base} functionality with {vctrs} (#1114). With the speed boost introduced in version 1.8.0 in Oct. 2022, {styler} is now up to 2x as fast as before release 1.8.0.

This release was created upon a request by the CRAN team to actively manage not just cached files but also the potentially empty cache directories they live in (#1118). Here are the changes in detail:

Thanks for everyone contributing to this release:

@IndrajeetPatil, @krlmlr, @kyleam, @MichaelChirico, @mvanaman, @olivroy, and @vvarik.

styler 1.9.1

Bug fixes

Other

Thanks for everyone who contributed to this release:

@dpprdan, @flying-sheep, @giocomai and @MichaelChirico.

styler 1.9.0

Features

# old style: remains compliant and won't be re-styled
my_fun <- function(long_argument = 2,
                   indent_up_to_first = "x") {
  # ...
}

# new style: now also compliant and won't be re-styled
my_fun <- function(
    long_argument = 2,
    indent_double = "x") {
  # ...
}

You can also use the R package {codegrip} to toggle between the two modes (#1083).

Bug fixes

Other user-facing changes

Infrastructure

Internals

A big shout out to anyone who contributed to this release:

@balthasars, @hadley, @IndrajeetPatil, @juliangrimm225 and @krlmlr.

styler 1.8.1

Features

Other

This release was requested by CRAN to resolve an R CMD Check note (#1044). A big hand to everyone who made this release possible:

Dave Jarvis, @IndrajeetPatil, @lorenzwalthert, @MichaelChirico, @Polkas, and @Robinlovelace.

styler 1.8.0

{styler} 1.8.0 comes with a host of new features, around 40% speed improvement, bug fixes and the removal of 8 recursive dependencies. We also welcome @IndrajeetPatil as a new contributor to {styler}, who has contributed significantly to this and and previous releases.

Features

Bug Fixes

Documentation

Performance and code quality improvements

Dependency related changes

In total, 8 recursive dependencies are removed: {ellipsis}, {pillar}, {rematch2}, {tibble}, {utf8}, {fansi}, {lifecycle}, {pkgconfig}.

Infrastructure

A big hand to everyone who made this release possible:

@behrman, @EngineerDanny, @gavinsimpson, @IndrajeetPatil, @jabenninghoff, @krlmlr, @lorenzwalthert, @MichaelChirico, @moodymudskipper, @RaymondBalise, @Robinlovelace, @sebffischer, @sgorm123, @stefanoborini, and @wdkrnls.

styler 1.7.0

API changes

Features

Documentation

Bug fixes

Infrastructure

Thanks to all contributors that made this release possible:

@bersbersbers, @daniel-wrench, @dbykova, @EngrStudent, @hadley, @IndrajeetPatil, @jam1015, @jooyoungseo, @kalaschnik, @kaytif, @kpagacz, @krlmlr, @lionel-, @lorenzwalthert, @maelle, @MichaelChirico, @mine-cetinkaya-rundel, @neuwirthe, @Polkas, @pwang2, @sebffischer, @ShixiangWang, @ssh352, and @xjtusjtu.

styler 1.6.2

styler 1.6.1

We’d like to thank all people who helped making this release possible:

@bersbersbers, @eutwt, @IndrajeetPatil, @j-mammen, @jennybc, @JohannesNE, @jonkeane, @lorenzwalthert, and @MichaelChirico.

styler 1.5.1

Alignment detection

Other new features

Minor changes and fixes

We’d like to thank everyone who has furthered the development of the latest release of styler through their contributions in issues and pull requests:

@ardydavari, @gadenbuie, @IndrajeetPatil, @jasonhan-vassar, @laresbernardo, @lorenzwalthert, @MichaelChirico, @Moohan, @njtierney, @pat-s, @psychelzh, @pvalders, @RoyalTS, and @russHyde.

styler 1.4.1

Thanks to everyone who contributed to this release:

@krlmlr, @lorenzwalthert, and @renkun-ken.

styler 1.4.0

API Changes

new

deprecated

Major changes

Minor changes and fixes

Infrastructure changes

Thanks to all the people who made this release possible:

@assignUser, @ColmanHumphrey, @davidchall, @espinielli, @giko45, @hadley, @IndrajeetPatil, @intiben, @jamespeapen, @jthomasmock, @Kalaschnik, @kevinushey, @krlmlr, @lcolladotor, @MichaelChirico, @michaelquinn32, @mine-cetinkaya-rundel, @pat-s, @PMassicotte, @QuLogic, @renkun-ken, @RichardJActon, @seed-of-apricot, @select-id-from-users, @SimonDedman, @stefanoborini, @swsoyee, and @Winterstorm-j.

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)