Skip to content

Release styler 1.4.0 #755

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Mar 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: styler
Title: Non-Invasive Pretty Printing of R Code
Version: 1.3.2.9000
Version: 1.4.0
Authors@R:
c(person(given = "Kirill",
family = "Müller",
Expand All @@ -11,8 +11,8 @@ Authors@R:
family = "Walthert",
role = c("cre", "aut"),
email = "[email protected]"))
Description: Pretty-prints R code without changing the user's formatting
intent.
Description: Pretty-prints R code without changing the user's
formatting intent.
License: MIT + file LICENSE
URL: https://github.com/r-lib/styler, https://styler.r-lib.org
BugReports: https://github.com/r-lib/styler/issues
Expand Down Expand Up @@ -44,8 +44,8 @@ VignetteBuilder:
knitr
Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE, roclets = c("rd", "namespace", "collate",
"pkgapi::api_roclet"))
Roxygen: list(markdown = TRUE, roclets = c("rd", "namespace",
"collate", "pkgapi::api_roclet"))
RoxygenNote: 7.1.1.9001
Collate:
'addins.R'
Expand Down
53 changes: 31 additions & 22 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# styler 1.3.2.9000 (Development)
# styler 1.4.0

## API Changes

**new**

- `style_file()` and friends gain argument `dry` to control if changes should be
applied to files or not (#634).

Expand All @@ -10,9 +12,6 @@
styling a selection picks that up, e.g. you can style a function body and
indention is preserved (#725).

- added an option (`styler.test_dir_writeable`) that changes test behavior to
not directly modify test files in the current directory (#548).

- added an option for disabling all communication when using the package
(`styler.quiet`) (#640).

Expand All @@ -23,36 +22,43 @@
style tokens, you had to always also style spaces, indention, line breaks as
well (#705, #707).

- added an option (`styler.test_dir_writeable`) that changes test behavior to
not directly modify test files in the current directory (#548).

- New argument `transformers_drop` in `create_style_guide()` to be populated
with new helper function `specify_transformers_drop()` for specifying
conditions under which transformers are not going to be used and can therefore
be omitted without effecting the result of styling (#711).

**deprecated**

- The environment variable `save_after_styling` is deprecated in favor of the R
option `styler.save_after_styling` to control if a file is saved after styling
with the RStudio Addin. Note than in RStudio >= 1.3.0, you can auto-save edits
in general (Code -> Saving -> Auto-Save), e.g. on idle editor or focus loss,
so this feature becomes less relevant (#631, #726).


## Major changes

- styler is now distributed under the MIT license (#751).

- Documentation overhaul: New README, new "Get started" pkgdown page, new
vignettes on `strict = FALSE`, `Adoption` renamed to `Third-party
integrations`, minor other doc improvements (#741, #643, #618, #614, #677,
#651, #667, #672, #687, #752, #754).
integrations` (#741), adding search to pkgdown (#623), group functions in
pkgdown reference page (#625), minor other doc improvements (#643, #618, #614,
#677, #651, #667, #672, #687, #752, #754).

- `@exampleIsf` roxygen tag for conditional examples is now supported (#743).

- The environment variable `save_after_styling` is deprecated in favor of the R
option `styler.save_after_styling` to control if a file is saved after styling
with the RStudio Addin. Note than in RStudio >= 1.3.0, you can auto-save edits
in general (Code -> Saving -> Auto-Save), e.g. on idle editor or focus loss,
so this feature becomes less relevant (#631, #726).

- blank lines in function calls and headers are now removed, for the former only
when there are no comments before or after the blank line (#629, #630, #635,
#723).

- speed improvements: ~10% when cache is activated because transformers are not
captured as character anymore (#679), ~3% in low-level optimization (#691). 7%
by requiring magrittr 2.0 (#681), ~8% by dropping unused transformers (#711),
4% by avoiding unnecessary sorting in internals (#739).
- speed improvements: 15% faster on new code, 70% on repeated styling of
compliant code (The latter is not so relevant because it was almost
instantaneous already). Most relevant contributions were #679, #691, #681,
#711, #739.

- `#<<` is now recognized as the xaringan marker and no space is added after`#`
(#700).
Expand All @@ -75,8 +81,6 @@

- empty lines are now removed between pipes and assignments (#645, #710).

- overhaul pgkdown site: Add search (#623), group function in Reference (#625).

- multiple `@examples` roxygen tags in a code block of `#'` are no longer
squashed (#748).

Expand All @@ -98,8 +102,6 @@

- simplification of internals (#692).

- include `test-*` files in styling pre-commit hook (#724).

## Infrastructure changes

- switched from travis and AppVeyor to GitHub Actions (#653, #660).
Expand All @@ -108,6 +110,13 @@
[lorenzwalthert/touchstone](https://github.com/lorenzwalthert/touchstone)
(#674, #684, #698).

- include `test-*` files in styling pre-commit hook (#724).


Thanks to all the people who made this release possible:

[&#x0040;assignUser](https://github.com/assignUser), [&#x0040;ColmanHumphrey](https://github.com/ColmanHumphrey), [&#x0040;davidchall](https://github.com/davidchall), [&#x0040;espinielli](https://github.com/espinielli), [&#x0040;giko45](https://github.com/giko45), [&#x0040;hadley](https://github.com/hadley), [&#x0040;IndrajeetPatil](https://github.com/IndrajeetPatil), [&#x0040;intiben](https://github.com/intiben), [&#x0040;jamespeapen](https://github.com/jamespeapen), [&#x0040;jthomasmock](https://github.com/jthomasmock), [&#x0040;Kalaschnik](https://github.com/Kalaschnik), [&#x0040;kevinushey](https://github.com/kevinushey), [&#x0040;krlmlr](https://github.com/krlmlr), [&#x0040;lcolladotor](https://github.com/lcolladotor), [&#x0040;MichaelChirico](https://github.com/MichaelChirico), [&#x0040;michaelquinn32](https://github.com/michaelquinn32), [&#x0040;mine-cetinkaya-rundel](https://github.com/mine-cetinkaya-rundel), [&#x0040;pat-s](https://github.com/pat-s), [&#x0040;PMassicotte](https://github.com/PMassicotte), [&#x0040;QuLogic](https://github.com/QuLogic), [&#x0040;renkun-ken](https://github.com/renkun-ken), [&#x0040;RichardJActon](https://github.com/RichardJActon), [&#x0040;seed-of-apricot](https://github.com/seed-of-apricot), [&#x0040;select-id-from-users](https://github.com/select-id-from-users), [&#x0040;SimonDedman](https://github.com/SimonDedman), [&#x0040;stefanoborini](https://github.com/stefanoborini), [&#x0040;swsoyee](https://github.com/swsoyee), and [&#x0040;Winterstorm-j](https://github.com/Winterstorm-j).

# styler 1.3.2

Release upon request by the CRAN team.
Expand Down Expand Up @@ -200,7 +209,7 @@ Thanks to all contributors involved, in particular
[&#x0040;davidski](https://github.com/davidski),
[&#x0040;IndrajeetPatil](https://github.com/IndrajeetPatil),
[&#x0040;pat-s](https://github.com/pat-s), and
[&#x0040;programming-wizard](https://github.com/programming-wizard).
[&#x0040;programming-wizard](https://github.com).

# styler 1.2.0

Expand Down Expand Up @@ -325,7 +334,7 @@ else you can use styler functionality:
frames with `drake::drake_plan_source()`.

* Adding styler as a fixer to the [ale
Plug-in](https://github.com/w0rp/ale/pull/2401#issuecomment-485942966) for
Plug-in](https://github.com/dense-analysis/ale/pull/2401) for
VIM.

Thanks to all contributors involved, in particular
Expand Down
2 changes: 1 addition & 1 deletion R/rules-line-breaks.R
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ style_line_break_around_curly <- function(strict, pd) {
#' With \{rlang\} version 0.4, a new syntactic sugar is introduced, the
#' curly-curly operator. It interprets this code in a special way:
#' `call(\{\{ x \}\})`. See this
#' [blog post](https://www.tidyverse.org/articles/2019/06/rlang-0-4-0/)
#' [blog post](https://www.tidyverse.org/blog/2019/06/rlang-0-4-0/)
#' on the topic. Here, the curly-curly sugar is understood as two opening
#' curly braces, followed by an expression followed by two closing curly braces,
#' e.g. `\{\{1\}\}`. `\{\{1\} + 1\}` does not contain the curly-curly syntactic
Expand Down
12 changes: 7 additions & 5 deletions R/set-assert-args.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,25 @@ set_arg_write_tree <- function(write_tree) {
#' @inheritParams make_transformer
#' @keywords internal
assert_transformers <- function(transformers) {
version_cutoff <- 1.5
no_name <- is.null(transformers$style_guide_name)
no_version <- is.null(transformers$style_guide_version)
if (no_name || no_version) {
action <- ifelse(utils::packageVersion("styler") >= 1.4,
"are not supported", "won't be supported"
action <- ifelse(utils::packageVersion("styler") >= version_cutoff,
"are not supported anymore",
"depreciated and will be removed in a future version of styler."
)
message <- paste(
"Style guides without a name and a version field are depreciated and",
action, "in styler >= 1.4. \nIf you are a user: Open an issue on",
"Style guides without a name and a version field are",
action, "\nIf you are a user: Open an issue on",
"https://github.com/r-lib/styler and provide a reproducible example",
"of this error. \nIf you are a developer:",
"When you create a style guide with `styler::create_style_guide()`, the",
"argument `style_guide_name` and `style_guide_version` should be",
"non-NULL. See help(\"create_style_guide\") for how to set them."
)

if (utils::packageVersion("styler") >= 1.4) {
if (utils::packageVersion("styler") >= version_cutoff) {
rlang::abort(message)
} else {
rlang::warn(message)
Expand Down
4 changes: 3 additions & 1 deletion R/style-guides.R
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,9 @@ tidyverse_style <- function(scope = "tokens",
#' }
#' set_line_break_before_curly_opening_style <- function() {
#' create_style_guide(
#' line_break = tibble::lst(set_line_break_before_curly_opening)
#' line_break = tibble::lst(set_line_break_before_curly_opening),
#' style_guide_name = "some-style-guide",
#' style_guide_version = "some-version"
#' )
#' }
#' style_text(
Expand Down
4 changes: 2 additions & 2 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ knitr::opts_chunk$set(

<!-- badges: start -->
[![R build status](https://github.com/r-lib/styler/workflows/R-CMD-check/badge.svg)](https://github.com/r-lib/styler/actions)
[![Life cycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://www.tidyverse.org/lifecycle/#stable)
[![Life cycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html)
[![codecov test coverage](https://codecov.io/gh/r-lib/styler/branch/master/graph/badge.svg)](https://codecov.io/gh/r-lib/styler)
[![CRAN Status](https://www.r-pkg.org/badges/version/styler)](https://cran.r-project.org/package=styler)
<!-- badges: end -->
Expand Down Expand Up @@ -68,4 +68,4 @@ The following online docs are available:

- [latest CRAN release](https://styler.r-lib.org).

- [GitHub development version](https://styler.r-lib.org/dev).
- [GitHub development version](https://styler.r-lib.org/dev/).
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
[![R build
status](https://github.com/r-lib/styler/workflows/R-CMD-check/badge.svg)](https://github.com/r-lib/styler/actions)
[![Life cycle:
stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://www.tidyverse.org/lifecycle/#stable)
stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html)
[![codecov test
coverage](https://codecov.io/gh/r-lib/styler/branch/master/graph/badge.svg)](https://codecov.io/gh/r-lib/styler)
[![CRAN
Expand Down Expand Up @@ -56,4 +56,4 @@ The following online docs are available:

- [latest CRAN release](https://styler.r-lib.org).

- [GitHub development version](https://styler.r-lib.org/dev).
- [GitHub development version](https://styler.r-lib.org/dev/).
34 changes: 28 additions & 6 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,41 @@
## Test environments

* local OS X install (10.15.13): R 3.6.1
* ubuntu 14.04 (on travis-ci): R devel, R 3.6, R 3.5, R 3.4, R 3.2
* win-builder: R devel, R 3.6.1
* local OS X install (10.15.7): R 4.0.3
* ubuntu 16.04 (on GitHub Actions): R devel, R 4.0.3, R 3.6, R 3.5, R 3.4, R 3.3
* Windows Server 10 (on GitHub Actions): R 3.6, R 4.0.3
* win-builder: R devel

## R CMD check results

0 ERRORS | 0 WARNINGS | 0 NOTES
0 ERRORS | 0 WARNINGS | 1 NOTES

The note was generated on winbuilder when incoming checks were enabled only and
contained many blocks like this:

```
Found the following (possibly) invalid URLs:
URL: https://github.com/ropensci/drake
From: inst/doc/third-party-integrations.html
NEWS.md
Status: 429
Message: Too Many Requests
```

It seems my package contains many URLs to GitHub and their rate limit prevents
the checking of all of them. I confirm that all URLs in my
package are compliant with the requirements of CRAN.

## Downstream Dependencies

I also ran R CMD check on all downstream dependencies of styler using the
revdepcheck package. The
downstream dependencies are: exampletestr, languageserver, crunch,
drake, knitr, nph, reprex, shinydashboardPlus, tradestatistics, usethis.
downstream dependencies are:

* Reverse imports: biocthis, exampletestr, languageserver, questionr,
shinyobjects, ShinyQuickStarter, systemPipeShiny.
* Reverse suggests: autothresholdr, crunch, datastructures, drake, epigraphdb,
knitr, netReg, nph, precommit, reprex, shinydashboardPlus, shinyMonacoEditor,
usethis

All of them finished R CMD CHECK with the same number of ERRORS, WARNINGS and
NOTES as with the current CRAN version of styler, which means the new
Expand Down
17 changes: 17 additions & 0 deletions inst/WORDLIST
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ arg
AsIs
AST
aut
autothresholdr
backport
benchmarking
biocthis
bootswatch
BugReports
cancelling
Expand All @@ -28,6 +30,7 @@ coventions
covr
cran
cre
datastructures
dec
deps
desc
Expand All @@ -48,10 +51,12 @@ env
EOF
EOL
EOLs
epigraphdb
eq
EQ
eval
examplesIf
exampletestr
expr
expr EQ
fileext
Expand Down Expand Up @@ -88,6 +93,7 @@ Kirill
knitr
krlmlr
labelled
languageserver
LazyData
levelName
LF
Expand All @@ -106,7 +112,9 @@ mutli
na
navbar
netlify
netReg
NONINFRINGEMENT
nph
NUM
oldrel
os
Expand All @@ -129,6 +137,7 @@ prefill
prettycode
PRs
purrr
questionr
rcmdcheck
RcppExports
rds
Expand All @@ -142,6 +151,7 @@ relevel
renv
repo
reprex
revdepcheck
RHUB
rlang
rlang's
Expand Down Expand Up @@ -180,6 +190,10 @@ sessioninfo
setCacheRootPath
setdiff
setenv
shinydashboardPlus
shinyMonacoEditor
shinyobjects
ShinyQuickStarter
sprintf
StackOverflow
startsWith
Expand All @@ -195,6 +209,7 @@ summarises
Sys
sysreq
sysreqs
systemPipeShiny
tempfile
testthat
tibble
Expand All @@ -217,11 +232,13 @@ unlink
unlinkunindention
unnest
unstyled
usethis
utf
VignetteBuilder
Visit'em
walthert
Walthert
winbuilder
withr
writeLines
www
Expand Down
4 changes: 3 additions & 1 deletion man/create_style_guide.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading