Skip to content

Commit 3668595

Browse files
Merge pull request #755 from lorenzwalthert/rc-1.4.0
- Release styler 1.4.0 (#755).
2 parents a8feea9 + 1fd5717 commit 3668595

15 files changed

+104
-52
lines changed

DESCRIPTION

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Type: Package
22
Package: styler
33
Title: Non-Invasive Pretty Printing of R Code
4-
Version: 1.3.2.9000
4+
Version: 1.4.0
55
Authors@R:
66
c(person(given = "Kirill",
77
family = "Müller",
@@ -11,8 +11,8 @@ Authors@R:
1111
family = "Walthert",
1212
role = c("cre", "aut"),
1313
email = "[email protected]"))
14-
Description: Pretty-prints R code without changing the user's formatting
15-
intent.
14+
Description: Pretty-prints R code without changing the user's
15+
formatting intent.
1616
License: MIT + file LICENSE
1717
URL: https://github.com/r-lib/styler, https://styler.r-lib.org
1818
BugReports: https://github.com/r-lib/styler/issues
@@ -44,8 +44,8 @@ VignetteBuilder:
4444
knitr
4545
Encoding: UTF-8
4646
LazyData: true
47-
Roxygen: list(markdown = TRUE, roclets = c("rd", "namespace", "collate",
48-
"pkgapi::api_roclet"))
47+
Roxygen: list(markdown = TRUE, roclets = c("rd", "namespace",
48+
"collate", "pkgapi::api_roclet"))
4949
RoxygenNote: 7.1.1.9001
5050
Collate:
5151
'addins.R'

NEWS.md

Lines changed: 31 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
# styler 1.3.2.9000 (Development)
1+
# styler 1.4.0
22

33
## API Changes
44

5+
**new**
6+
57
- `style_file()` and friends gain argument `dry` to control if changes should be
68
applied to files or not (#634).
79

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

13-
- added an option (`styler.test_dir_writeable`) that changes test behavior to
14-
not directly modify test files in the current directory (#548).
15-
1615
- added an option for disabling all communication when using the package
1716
(`styler.quiet`) (#640).
1817

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

25+
- added an option (`styler.test_dir_writeable`) that changes test behavior to
26+
not directly modify test files in the current directory (#548).
27+
2628
- New argument `transformers_drop` in `create_style_guide()` to be populated
2729
with new helper function `specify_transformers_drop()` for specifying
2830
conditions under which transformers are not going to be used and can therefore
2931
be omitted without effecting the result of styling (#711).
3032

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

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

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

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

42-
- The environment variable `save_after_styling` is deprecated in favor of the R
43-
option `styler.save_after_styling` to control if a file is saved after styling
44-
with the RStudio Addin. Note than in RStudio >= 1.3.0, you can auto-save edits
45-
in general (Code -> Saving -> Auto-Save), e.g. on idle editor or focus loss,
46-
so this feature becomes less relevant (#631, #726).
47-
4854
- blank lines in function calls and headers are now removed, for the former only
4955
when there are no comments before or after the blank line (#629, #630, #635,
5056
#723).
5157

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

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

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

78-
- overhaul pgkdown site: Add search (#623), group function in Reference (#625).
79-
8084
- multiple `@examples` roxygen tags in a code block of `#'` are no longer
8185
squashed (#748).
8286

@@ -98,8 +102,6 @@
98102

99103
- simplification of internals (#692).
100104

101-
- include `test-*` files in styling pre-commit hook (#724).
102-
103105
## Infrastructure changes
104106

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

113+
- include `test-*` files in styling pre-commit hook (#724).
114+
115+
116+
Thanks to all the people who made this release possible:
117+
118+
[&#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).
119+
111120
# styler 1.3.2
112121

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

205214
# styler 1.2.0
206215

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

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

331340
Thanks to all contributors involved, in particular

R/rules-line-breaks.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ style_line_break_around_curly <- function(strict, pd) {
122122
#' With \{rlang\} version 0.4, a new syntactic sugar is introduced, the
123123
#' curly-curly operator. It interprets this code in a special way:
124124
#' `call(\{\{ x \}\})`. See this
125-
#' [blog post](https://www.tidyverse.org/articles/2019/06/rlang-0-4-0/)
125+
#' [blog post](https://www.tidyverse.org/blog/2019/06/rlang-0-4-0/)
126126
#' on the topic. Here, the curly-curly sugar is understood as two opening
127127
#' curly braces, followed by an expression followed by two closing curly braces,
128128
#' e.g. `\{\{1\}\}`. `\{\{1\} + 1\}` does not contain the curly-curly syntactic

R/set-assert-args.R

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,25 @@ set_arg_write_tree <- function(write_tree) {
2121
#' @inheritParams make_transformer
2222
#' @keywords internal
2323
assert_transformers <- function(transformers) {
24+
version_cutoff <- 1.5
2425
no_name <- is.null(transformers$style_guide_name)
2526
no_version <- is.null(transformers$style_guide_version)
2627
if (no_name || no_version) {
27-
action <- ifelse(utils::packageVersion("styler") >= 1.4,
28-
"are not supported", "won't be supported"
28+
action <- ifelse(utils::packageVersion("styler") >= version_cutoff,
29+
"are not supported anymore",
30+
"depreciated and will be removed in a future version of styler."
2931
)
3032
message <- paste(
31-
"Style guides without a name and a version field are depreciated and",
32-
action, "in styler >= 1.4. \nIf you are a user: Open an issue on",
33+
"Style guides without a name and a version field are",
34+
action, "\nIf you are a user: Open an issue on",
3335
"https://github.com/r-lib/styler and provide a reproducible example",
3436
"of this error. \nIf you are a developer:",
3537
"When you create a style guide with `styler::create_style_guide()`, the",
3638
"argument `style_guide_name` and `style_guide_version` should be",
3739
"non-NULL. See help(\"create_style_guide\") for how to set them."
3840
)
3941

40-
if (utils::packageVersion("styler") >= 1.4) {
42+
if (utils::packageVersion("styler") >= version_cutoff) {
4143
rlang::abort(message)
4244
} else {
4345
rlang::warn(message)

R/style-guides.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,9 @@ tidyverse_style <- function(scope = "tokens",
298298
#' }
299299
#' set_line_break_before_curly_opening_style <- function() {
300300
#' create_style_guide(
301-
#' line_break = tibble::lst(set_line_break_before_curly_opening)
301+
#' line_break = tibble::lst(set_line_break_before_curly_opening),
302+
#' style_guide_name = "some-style-guide",
303+
#' style_guide_version = "some-version"
302304
#' )
303305
#' }
304306
#' style_text(

README.Rmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ knitr::opts_chunk$set(
1818

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

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

71-
- [GitHub development version](https://styler.r-lib.org/dev).
71+
- [GitHub development version](https://styler.r-lib.org/dev/).

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
[![R build
99
status](https://github.com/r-lib/styler/workflows/R-CMD-check/badge.svg)](https://github.com/r-lib/styler/actions)
1010
[![Life cycle:
11-
stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://www.tidyverse.org/lifecycle/#stable)
11+
stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html)
1212
[![codecov test
1313
coverage](https://codecov.io/gh/r-lib/styler/branch/master/graph/badge.svg)](https://codecov.io/gh/r-lib/styler)
1414
[![CRAN
@@ -56,4 +56,4 @@ The following online docs are available:
5656

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

59-
- [GitHub development version](https://styler.r-lib.org/dev).
59+
- [GitHub development version](https://styler.r-lib.org/dev/).

cran-comments.md

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,41 @@
11
## Test environments
22

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

78
## R CMD check results
89

9-
0 ERRORS | 0 WARNINGS | 0 NOTES
10+
0 ERRORS | 0 WARNINGS | 1 NOTES
11+
12+
The note was generated on winbuilder when incoming checks were enabled only and
13+
contained many blocks like this:
14+
15+
```
16+
Found the following (possibly) invalid URLs:
17+
URL: https://github.com/ropensci/drake
18+
From: inst/doc/third-party-integrations.html
19+
NEWS.md
20+
Status: 429
21+
Message: Too Many Requests
22+
```
23+
24+
It seems my package contains many URLs to GitHub and their rate limit prevents
25+
the checking of all of them. I confirm that all URLs in my
26+
package are compliant with the requirements of CRAN.
1027

1128
## Downstream Dependencies
1229

1330
I also ran R CMD check on all downstream dependencies of styler using the
1431
revdepcheck package. The
15-
downstream dependencies are: exampletestr, languageserver, crunch,
16-
drake, knitr, nph, reprex, shinydashboardPlus, tradestatistics, usethis.
32+
downstream dependencies are:
33+
34+
* Reverse imports: biocthis, exampletestr, languageserver, questionr,
35+
shinyobjects, ShinyQuickStarter, systemPipeShiny.
36+
* Reverse suggests: autothresholdr, crunch, datastructures, drake, epigraphdb,
37+
knitr, netReg, nph, precommit, reprex, shinydashboardPlus, shinyMonacoEditor,
38+
usethis
1739

1840
All of them finished R CMD CHECK with the same number of ERRORS, WARNINGS and
1941
NOTES as with the current CRAN version of styler, which means the new

inst/WORDLIST

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ arg
99
AsIs
1010
AST
1111
aut
12+
autothresholdr
1213
backport
1314
benchmarking
15+
biocthis
1416
bootswatch
1517
BugReports
1618
cancelling
@@ -28,6 +30,7 @@ coventions
2830
covr
2931
cran
3032
cre
33+
datastructures
3134
dec
3235
deps
3336
desc
@@ -48,10 +51,12 @@ env
4851
EOF
4952
EOL
5053
EOLs
54+
epigraphdb
5155
eq
5256
EQ
5357
eval
5458
examplesIf
59+
exampletestr
5560
expr
5661
expr EQ
5762
fileext
@@ -88,6 +93,7 @@ Kirill
8893
knitr
8994
krlmlr
9095
labelled
96+
languageserver
9197
LazyData
9298
levelName
9399
LF
@@ -106,7 +112,9 @@ mutli
106112
na
107113
navbar
108114
netlify
115+
netReg
109116
NONINFRINGEMENT
117+
nph
110118
NUM
111119
oldrel
112120
os
@@ -129,6 +137,7 @@ prefill
129137
prettycode
130138
PRs
131139
purrr
140+
questionr
132141
rcmdcheck
133142
RcppExports
134143
rds
@@ -142,6 +151,7 @@ relevel
142151
renv
143152
repo
144153
reprex
154+
revdepcheck
145155
RHUB
146156
rlang
147157
rlang's
@@ -180,6 +190,10 @@ sessioninfo
180190
setCacheRootPath
181191
setdiff
182192
setenv
193+
shinydashboardPlus
194+
shinyMonacoEditor
195+
shinyobjects
196+
ShinyQuickStarter
183197
sprintf
184198
StackOverflow
185199
startsWith
@@ -195,6 +209,7 @@ summarises
195209
Sys
196210
sysreq
197211
sysreqs
212+
systemPipeShiny
198213
tempfile
199214
testthat
200215
tibble
@@ -217,11 +232,13 @@ unlink
217232
unlinkunindention
218233
unnest
219234
unstyled
235+
usethis
220236
utf
221237
VignetteBuilder
222238
Visit'em
223239
walthert
224240
Walthert
241+
winbuilder
225242
withr
226243
writeLines
227244
www

man/create_style_guide.Rd

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)