Skip to content

Commit

Permalink
Merge pull request #1145 from r-lib/rc-1.10.2
Browse files Browse the repository at this point in the history
Release {styler} v1.10.2
  • Loading branch information
lorenzwalthert committed Aug 29, 2023
2 parents ca400ad + f6a311d commit 1976817
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 29 deletions.
2 changes: 1 addition & 1 deletion 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.10.1
Version: 1.10.2
Authors@R:
c(person(given = "Kirill",
family = "Müller",
Expand Down
20 changes: 20 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
<!-- NEWS.md is maintained by https://cynkra.github.io/fledge, do not edit -->

# styler 1.10.2

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

**Minor changes**

* Use cli messaging for cache (#1127).
* Use latest (and stable!) pre-commit (#1144).
* Fix CRAN warning on invalid numeric version inputs (#1143).
* Bump JamesIves/github-pages-deploy-action from 4.4.2 to 4.4.3 (#1139).
* fix pre-commit (#1132).
* Don't require dplyr anywhere (#1131).

We thank everyone who helped making this release possible.

[&#x0040;krlmlr](https://github.com/krlmlr), [&#x0040;lorenzwalthert](https://github.com/lorenzwalthert), [&#x0040;MichaelChirico](https://github.com/MichaelChirico), [&#x0040;olivroy](https://github.com/olivroy), [&#x0040;rkrug](https://github.com/rkrug), and [&#x0040;rossdrucker](https://github.com/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.
Expand Down
1 change: 0 additions & 1 deletion R/parse.R
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ ensure_correct_txt <- function(pd, text) {
#' changes from "all strings" to "all problematic strings", is partly
#' misleading and this approach was chosen for performance reasons only.
#' @param pd A parse table.
#' @param text The initial code to style.
#' @keywords internal
is_insufficiently_parsed_string <- function(pd) {
grepl("^\\[", pd$text) & pd$token == "STR_CONST"
Expand Down
22 changes: 11 additions & 11 deletions R/rules-line-breaks.R
Original file line number Diff line number Diff line change
Expand Up @@ -268,21 +268,20 @@ set_line_break_after_assignment <- function(pd) {

#' Set line break for multi-line function calls
#' @param pd A parse table.
#' @param except_token_after A character vector with tokens after "'('" that do
#' not cause a line break after "'('".
#' @param except_text_before A character vector with text before "'('" that do
#' not cause a line break after "'('".
#' @param except_token_before A character vector with text before "')'" that do
#' not cause a line break before "')'".
#' @param force_text_before A character vector with text before "'('" that
#' forces a line break after every argument in the call.
#' @param except_token_before A character vector with tokens that do
#' not cause a line break after them.
#' @name set_line_break_if_call_is_multi_line
#'
#' @keywords internal
NULL

#' Sets line break after opening parenthesis
#'
#' @param pd The parse table.
#' @param except_token_after The tokens after the token that cause an exception.
#' @param except_text_before A character vector with text before a token that
#' does not cause a line break.
#' @param force_text_before A character vector with text before "'('" that
#' forces a line break after every argument in the call.
#' @details
#' In general, every call that is multi-line has a line break after the opening
#' parenthesis. Exceptions:
Expand Down Expand Up @@ -341,7 +340,7 @@ set_line_break_after_opening_if_call_is_multi_line <- function(pd,
#' position of the first named argument and breaks returns the index of it.
#' If there is no named argument, the line is broken right after the opening
#' parenthesis.
#' @inheritParams set_line_break_if_call_is_multi_line
#' @param pd A parse table.
#' @keywords internal
find_line_break_position_in_multiline_call <- function(pd) {
candidate <- (which(pd$token == "EQ_SUB") - 1L)[1L]
Expand Down Expand Up @@ -377,7 +376,8 @@ set_line_break_before_closing_call <- function(pd, except_token_before) {
}


#' @rdname set_line_break_if_call_is_multi_line
#' @describeIn set_line_break_if_call_is_multi_line Remove line breaks in
#' function calls.
#' @keywords internal
remove_line_break_in_fun_call <- function(pd, strict) {
if (is_function_call(pd)) {
Expand Down
4 changes: 2 additions & 2 deletions cran-comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ editor_options:
wrap: 79
---

This is a release requested by the CRAN team to delete the population of the
user's cache while building vignettes.
This is a release requested by the CRAN team to comply with
`R_CHECK_STOP_ON_INVALID_NUMERIC_VERSION_INPUTS`.


## Test environments
Expand Down
2 changes: 0 additions & 2 deletions man/is_insufficiently_parsed_string.Rd

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

11 changes: 11 additions & 0 deletions man/set_line_break_after_opening_if_call_is_multi_line.Rd

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

16 changes: 5 additions & 11 deletions man/set_line_break_if_call_is_multi_line.Rd

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

2 changes: 1 addition & 1 deletion tests/testthat/tests-cache-require-serial.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ test_that("top-level test: Caches top-level expressions efficiently on style_tex
partially_cached_benchmark["elapsed"] * 1.5,
not_cached_benchmark["elapsed"]
)
expect_lt(full_cached_benchmark["elapsed"] * 35, benchmark["elapsed"])
expect_lt(full_cached_benchmark["elapsed"] * 30, benchmark["elapsed"])
})


Expand Down

0 comments on commit 1976817

Please sign in to comment.