diff --git a/.github/workflows/pre-commit.yaml b/.github/workflows/pre-commit.yaml index b3b758db3..c71b81c23 100644 --- a/.github/workflows/pre-commit.yaml +++ b/.github/workflows/pre-commit.yaml @@ -25,7 +25,9 @@ jobs: - uses: actions/checkout@v5 with: fetch-depth: 0 - + - name: Setup system dependencies + run: | + sudo apt install cmake libcurl4-openssl-dev libnode-dev pandoc - name: Set up Python uses: actions/setup-python@v6.0.0 with: diff --git a/DESCRIPTION b/DESCRIPTION index c8d2d32f6..3c24cef7e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: styler Title: Non-Invasive Pretty Printing of R Code -Version: 1.11.0 +Version: 1.11.0.9001 Authors@R: c(person(given = "Kirill", family = "Müller", @@ -53,7 +53,6 @@ Roxygen: list(markdown = TRUE, roclets = c( "rd", "namespace", "collate", if (rlang::is_installed("pkgapi")) "pkgapi::api_roclet" else { warning("Please install r-lib/pkgapi to make sure the file API is kept up to date"); NULL})) -RoxygenNote: 7.3.3 Language: en-US Config/testthat/edition: 3 Config/testthat/parallel: true @@ -107,3 +106,4 @@ Collate: 'vertical.R' 'visit.R' 'zzz.R' +Config/roxygen2/version: 8.0.0 diff --git a/R/indent.R b/R/indent.R index b6e12285b..b5a3cdb43 100644 --- a/R/indent.R +++ b/R/indent.R @@ -39,28 +39,29 @@ indent_without_paren_if_else <- function(pd, indent_by) { } needs_indention_now <- pd$lag_newlines[ next_non_comment(pd, which(pd$token == "')'")) - ] > 0L + ] > + 0L if (needs_indention_now) { pd$indent[expr_after_if] <- indent_by } - else_idx <- which(pd$token == "ELSE") - if (length(else_idx) == 0L) { + els_idx <- which(pd$token == "ELSE") + if (length(els_idx) == 0L) { return(pd) } - expr_after_else_idx <- next_non_comment(pd, else_idx) - has_else_without_curly_or_else_chid <- - any(pd$token == "ELSE") && - pd$child[[expr_after_else_idx]]$token[1L] != "'{'" && - pd$child[[expr_after_else_idx]]$token[1L] != "IF" + expr_after_else_idx <- next_non_comment(pd, els_idx) + has_else_without_curly_or_else_chid <- any(pd$token == "ELSE") && + pd$child[[expr_after_else_idx]]$token[1L] != "'{'" && + pd$child[[expr_after_else_idx]]$token[1L] != "IF" needs_indention_now <- pd$lag_newlines[ next_non_comment(pd, which(pd$token == "ELSE")) - ] > 0L + ] > + 0L if (has_else_without_curly_or_else_chid && needs_indention_now) { - pd$indent[seq(else_idx + 1L, nrow(pd))] <- indent_by + pd$indent[seq(els_idx + 1L, nrow(pd))] <- indent_by } pd } @@ -200,7 +201,6 @@ needs_indention_one <- function(pd, } - #' Set the multi-line column #' #' Sets the column `multi_line` in `pd` by checking row-wise whether any child diff --git a/R/initialize.R b/R/initialize.R index 87b0a1e62..d3b75c6f9 100644 --- a/R/initialize.R +++ b/R/initialize.R @@ -25,7 +25,6 @@ default_style_guide_attributes <- function(pd_flat) { } - #' Initialize attributes #' #' @name initialize_attributes diff --git a/R/io.R b/R/io.R index a0d8c2168..8eba2d96e 100644 --- a/R/io.R +++ b/R/io.R @@ -31,6 +31,7 @@ transform_utf8_one <- function(path, fun, dry) { identical_content <- identical(file_with_info$text, new) identical <- identical_content && !file_with_info$missing_EOF_line_break if (!identical) { + # fmt: skip switch(dry, fail = rlang::abort( paste0( diff --git a/R/style-guides.R b/R/style-guides.R index 6a5366c52..5cb3e2286 100644 --- a/R/style-guides.R +++ b/R/style-guides.R @@ -130,6 +130,7 @@ tidyverse_style <- function(scope = "tokens", line_break_manipulators <- if ("line_breaks" %in% scope) { list( + # fmt: skip remove_empty_lines_after_opening_and_before_closing_braces = remove_empty_lines_after_opening_and_before_closing_braces, set_line_break_around_comma_and_or = set_line_break_around_comma_and_or, @@ -159,8 +160,7 @@ tidyverse_style <- function(scope = "tokens", set_line_break_after_opening_if_call_is_multi_line, except_token_after = "COMMENT", # don't modify line break here - except_text_before = c("ifelse", "if_else"), - force_text_before = "switch" # force line break after first token + except_text_before = c("ifelse", "if_else") ) }, remove_line_break_in_fun_call = purrr::partial( @@ -238,6 +238,7 @@ tidyverse_style <- function(scope = "tokens", ) style_guide_name <- "styler::tidyverse_style@https://github.com/r-lib" + # fmt: skip create_style_guide( # transformer functions initialize = default_style_guide_attributes, diff --git a/R/testing.R b/R/testing.R index bce9f8b3c..d9eb124d4 100644 --- a/R/testing.R +++ b/R/testing.R @@ -178,6 +178,7 @@ style_empty <- function(text, base_indention = 0L) { #' @describeIn test_transformer Transformations for indention based on operators #' @keywords internal style_op <- function(text, base_indention = 0L) { + # fmt: skip transformers <- list( # transformer functions initialize = default_style_guide_attributes, diff --git a/R/token-create.R b/R/token-create.R index d793b89f8..50ae2b748 100644 --- a/R/token-create.R +++ b/R/token-create.R @@ -134,7 +134,6 @@ find_start_pos_id <- function(pd, } - #' Validate sequence of new position ids #' #' Ids created with `after = TRUE` can have `pos_id` values between x.0 and diff --git a/R/token-define.R b/R/token-define.R index 64813fa1d..265499277 100644 --- a/R/token-define.R +++ b/R/token-define.R @@ -1,4 +1,5 @@ # styler: off +# fmt: skip token <- rbind.data.frame( c("&", "logical", "AND"), c("&&", "logical", "AND2"), diff --git a/R/transform-code.R b/R/transform-code.R index 929ba8182..a89f49844 100644 --- a/R/transform-code.R +++ b/R/transform-code.R @@ -171,6 +171,7 @@ get_engine_pattern <- function() { #' @inheritParams separate_chunks #' @keywords internal get_knitr_pattern <- function(filetype) { + # fmt: skip switch(filetype, Rnw = knitr::all_patterns[["rnw"]], Rmd = knitr::all_patterns[["md"]] diff --git a/R/transform-files.R b/R/transform-files.R index 28dc79c50..ec1bc9fbf 100644 --- a/R/transform-files.R +++ b/R/transform-files.R @@ -381,7 +381,6 @@ apply_transformers <- function(pd_nested, transformers) { } - #' Check whether a round trip verification can be carried out #' #' If scope was set to "line_breaks" or lower (compare [tidyverse_style()]), diff --git a/man/alignment_drop_last_expr.Rd b/man/alignment_drop_last_expr.Rd index f67092d76..269b04993 100644 --- a/man/alignment_drop_last_expr.Rd +++ b/man/alignment_drop_last_expr.Rd @@ -12,7 +12,7 @@ an if, while or for statement or a function call. We don't call about that part, in fact it's important to remove it for alignment. See 'Examples'. } \examples{ -\dontshow{if (FALSE) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} +\dontshow{if (FALSE) withAutoprint(\{ # examplesIf} call( x = 12, y = 3, diff --git a/man/cache_activate.Rd b/man/cache_activate.Rd index 5187937a0..9a4080afb 100644 --- a/man/cache_activate.Rd +++ b/man/cache_activate.Rd @@ -22,9 +22,9 @@ Helper functions to control the behavior of caching. Simple wrappers around \code{\link[base:options]{base::options()}}. } \seealso{ -Other cache managers: -\code{\link{cache_clear}()}, -\code{\link{cache_info}()}, +Other cache managers: +\code{\link[=cache_clear]{cache_clear()}}, +\code{\link[=cache_info]{cache_info()}}, \code{\link{caching}} } \concept{cache managers} diff --git a/man/cache_clear.Rd b/man/cache_clear.Rd index 3a97a3bff..cb99941d7 100644 --- a/man/cache_clear.Rd +++ b/man/cache_clear.Rd @@ -24,9 +24,9 @@ Each version of styler has its own cache by default, because styling is potentially different with different versions of styler. } \seealso{ -Other cache managers: -\code{\link{cache_activate}()}, -\code{\link{cache_info}()}, +Other cache managers: +\code{\link[=cache_activate]{cache_activate()}}, +\code{\link[=cache_info]{cache_info()}}, \code{\link{caching}} } \concept{cache managers} diff --git a/man/cache_info.Rd b/man/cache_info.Rd index 363336316..381bbaa94 100644 --- a/man/cache_info.Rd +++ b/man/cache_info.Rd @@ -22,9 +22,9 @@ empty file of size 0 bytes for every cached expression. The inode is excluded from this displayed size but negligible. } \seealso{ -Other cache managers: -\code{\link{cache_activate}()}, -\code{\link{cache_clear}()}, +Other cache managers: +\code{\link[=cache_activate]{cache_activate()}}, +\code{\link[=cache_clear]{cache_clear()}}, \code{\link{caching}} } \concept{cache managers} diff --git a/man/caching.Rd b/man/caching.Rd index 59a7db6cb..61f1c691d 100644 --- a/man/caching.Rd +++ b/man/caching.Rd @@ -67,9 +67,9 @@ This can often be set in config files of CI/CD tools, e.g. see the } \seealso{ -Other cache managers: -\code{\link{cache_activate}()}, -\code{\link{cache_clear}()}, -\code{\link{cache_info}()} +Other cache managers: +\code{\link[=cache_activate]{cache_activate()}}, +\code{\link[=cache_clear]{cache_clear()}}, +\code{\link[=cache_info]{cache_info()}} } \concept{cache managers} diff --git a/man/create_pos_ids.Rd b/man/create_pos_ids.Rd index 4498e19f0..ba72b2909 100644 --- a/man/create_pos_ids.Rd +++ b/man/create_pos_ids.Rd @@ -27,9 +27,9 @@ create one. The validation is done with \code{\link[=validate_new_pos_ids]{valid Create valid pos_ids if possible } \seealso{ -Other token creators: -\code{\link{create_tokens}()}, -\code{\link{validate_new_pos_ids}()} +Other token creators: +\code{\link[=create_tokens]{create_tokens()}}, +\code{\link[=validate_new_pos_ids]{validate_new_pos_ids()}} } \concept{token creators} \keyword{internal} diff --git a/man/create_tokens.Rd b/man/create_tokens.Rd index 24ef302e3..5a922d9c8 100644 --- a/man/create_tokens.Rd +++ b/man/create_tokens.Rd @@ -61,9 +61,9 @@ styler. Must take value from token before, can't have a default.} Creates a terminal token represented as (a row of) a parse table. } \seealso{ -Other token creators: -\code{\link{create_pos_ids}()}, -\code{\link{validate_new_pos_ids}()} +Other token creators: +\code{\link[=create_pos_ids]{create_pos_ids()}}, +\code{\link[=validate_new_pos_ids]{validate_new_pos_ids()}} } \concept{token creators} \keyword{internal} diff --git a/man/dir_without_..Rd b/man/dir_without_..Rd index 61c560c8e..67edec39e 100644 --- a/man/dir_without_..Rd +++ b/man/dir_without_..Rd @@ -9,7 +9,7 @@ dir_without_.(path, recursive = TRUE, ...) \arguments{ \item{path}{A path.} -\item{...}{Passed to \code{\link[base:list.files]{base::dir()}}.} +\item{...}{Passed to \code{\link[base:dir]{base::dir()}}.} } \description{ When using \code{dir()}, you can set \code{full.names = FALSE}, but then you can only diff --git a/man/env_current.Rd b/man/env_current.Rd index bdd407371..cddb9e51f 100644 --- a/man/env_current.Rd +++ b/man/env_current.Rd @@ -1,12 +1,8 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/environments.R -\docType{data} \name{env_current} \alias{env_current} \title{The elements that are added to this environment are:} -\format{ -An object of class \code{environment} of length 0. -} \usage{ env_current } diff --git a/man/next_non_comment.Rd b/man/next_non_comment.Rd index b66b1825c..a2806fb8a 100644 --- a/man/next_non_comment.Rd +++ b/man/next_non_comment.Rd @@ -26,8 +26,8 @@ previous_non_comment(child, 4L) next_non_comment(child, 2L) } \seealso{ -Other third-party style guide helpers: +Other third-party style guide helpers: \code{\link{pd_is}}, -\code{\link{scope_normalize}()} +\code{\link[=scope_normalize]{scope_normalize()}} } \concept{third-party style guide helpers} diff --git a/man/pd_is.Rd b/man/pd_is.Rd index d05b1b731..3f935feb6 100644 --- a/man/pd_is.Rd +++ b/man/pd_is.Rd @@ -112,8 +112,8 @@ is_asymmetric_tilde_expr(pd$child[[1]]$child[[3]]) } \seealso{ -Other third-party style guide helpers: -\code{\link{next_non_comment}()}, -\code{\link{scope_normalize}()} +Other third-party style guide helpers: +\code{\link[=next_non_comment]{next_non_comment()}}, +\code{\link[=scope_normalize]{scope_normalize()}} } \concept{third-party style guide helpers} diff --git a/man/scope_normalize.Rd b/man/scope_normalize.Rd index bd98878e0..8dd712010 100644 --- a/man/scope_normalize.Rd +++ b/man/scope_normalize.Rd @@ -25,8 +25,8 @@ scope_normalize(I("tokens")) scope_normalize(I(c("indention", "tokens"))) } \seealso{ -Other third-party style guide helpers: -\code{\link{next_non_comment}()}, +Other third-party style guide helpers: +\code{\link[=next_non_comment]{next_non_comment()}}, \code{\link{pd_is}} } \concept{third-party style guide helpers} diff --git a/man/set_line_break_before_curly_opening.Rd b/man/set_line_break_before_curly_opening.Rd index 8501984dd..4f60ca388 100644 --- a/man/set_line_break_before_curly_opening.Rd +++ b/man/set_line_break_before_curly_opening.Rd @@ -19,7 +19,7 @@ line trigger } } \examples{ -\dontshow{if (FALSE) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} +\dontshow{if (FALSE) withAutoprint(\{ # examplesIf} tryCatch( { f(8) diff --git a/man/style_dir.Rd b/man/style_dir.Rd index 62c80e264..084fd8f28 100644 --- a/man/style_dir.Rd +++ b/man/style_dir.Rd @@ -112,7 +112,7 @@ See section 'Warning' for a good strategy to apply styling safely. } \examples{ -\dontshow{if (FALSE) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} +\dontshow{if (FALSE) withAutoprint(\{ # examplesIf} style_dir("path/to/dir", filetype = c("rmd", ".R")) # the following is identical (because of ... and defaults) @@ -123,10 +123,10 @@ style_dir(transformers = tidyverse_style(strict = TRUE)) \dontshow{\}) # examplesIf} } \seealso{ -Other stylers: -\code{\link{style_file}()}, -\code{\link{style_pkg}()}, -\code{\link{style_text}()}, +Other stylers: +\code{\link[=style_file]{style_file()}}, +\code{\link[=style_pkg]{style_pkg()}}, +\code{\link[=style_text]{style_text()}}, \code{\link{styler_addins}} } \concept{stylers} diff --git a/man/style_file.Rd b/man/style_file.Rd index 331abbdac..28cda32de 100644 --- a/man/style_file.Rd +++ b/man/style_file.Rd @@ -116,10 +116,10 @@ readLines(file) unlink(file) } \seealso{ -Other stylers: -\code{\link{style_dir}()}, -\code{\link{style_pkg}()}, -\code{\link{style_text}()}, +Other stylers: +\code{\link[=style_dir]{style_dir()}}, +\code{\link[=style_pkg]{style_pkg()}}, +\code{\link[=style_text]{style_text()}}, \code{\link{styler_addins}} } \concept{stylers} diff --git a/man/style_pkg.Rd b/man/style_pkg.Rd index 637cbc9a7..9c6581765 100644 --- a/man/style_pkg.Rd +++ b/man/style_pkg.Rd @@ -110,7 +110,7 @@ styling whether or not it was actually changed (or would be changed when } \examples{ -\dontshow{if (FALSE) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} +\dontshow{if (FALSE) withAutoprint(\{ # examplesIf} # the following is identical (because of ... and defaults) # but the first is most convenient: style_pkg(strict = TRUE) @@ -128,10 +128,10 @@ style_pkg("/path/to/pkg/", dry = "fail") \dontshow{\}) # examplesIf} } \seealso{ -Other stylers: -\code{\link{style_dir}()}, -\code{\link{style_file}()}, -\code{\link{style_text}()}, +Other stylers: +\code{\link[=style_dir]{style_dir()}}, +\code{\link[=style_file]{style_file()}}, +\code{\link[=style_text]{style_text()}}, \code{\link{styler_addins}} } \concept{stylers} diff --git a/man/style_text.Rd b/man/style_text.Rd index 0b79b6151..90dd4dbf8 100644 --- a/man/style_text.Rd +++ b/man/style_text.Rd @@ -59,10 +59,10 @@ style_text("a\%>\%b; a", scope = "tokens") style_text("a\%>\%b; a", scope = I("tokens")) } \seealso{ -Other stylers: -\code{\link{style_dir}()}, -\code{\link{style_file}()}, -\code{\link{style_pkg}()}, +Other stylers: +\code{\link[=style_dir]{style_dir()}}, +\code{\link[=style_file]{style_file()}}, +\code{\link[=style_pkg]{style_pkg()}}, \code{\link{styler_addins}} } \concept{stylers} diff --git a/man/styler-package.Rd b/man/styler-package.Rd index d69914d9e..fb6662ecc 100644 --- a/man/styler-package.Rd +++ b/man/styler-package.Rd @@ -40,6 +40,7 @@ Useful links: Authors: \itemize{ + \item Lorenz Walthert \email{lorenz.walthert@icloud.com} \item Kirill Müller \email{kirill@cynkra.com} (\href{https://orcid.org/0000-0002-1416-3412}{ORCID}) \item Indrajeet Patil \email{patilindrajeet.science@gmail.com} (\href{https://orcid.org/0000-0003-1995-6531}{ORCID}) } diff --git a/man/styler_addins.Rd b/man/styler_addins.Rd index 219dd4e8a..f9c2e8f7c 100644 --- a/man/styler_addins.Rd +++ b/man/styler_addins.Rd @@ -58,10 +58,10 @@ options( } } \seealso{ -Other stylers: -\code{\link{style_dir}()}, -\code{\link{style_file}()}, -\code{\link{style_pkg}()}, -\code{\link{style_text}()} +Other stylers: +\code{\link[=style_dir]{style_dir()}}, +\code{\link[=style_file]{style_file()}}, +\code{\link[=style_pkg]{style_pkg()}}, +\code{\link[=style_text]{style_text()}} } \concept{stylers} diff --git a/man/styler_options.Rd b/man/styler_options.Rd index 568af57cc..1ce549de0 100644 --- a/man/styler_options.Rd +++ b/man/styler_options.Rd @@ -18,7 +18,7 @@ The name of the style transformer to use in the addins. (default: \code{"styler::tidyverse_style()"}) \item \code{styler.cache_name}: character. The name of the styler cache to use. -(default: 1.11.0) +(default: 1.11.0.9001) \item \code{styler.cache_root}: character. The directory where the cache files are stored. For more, see \code{help("caching")}. (default: \code{NULL}) @@ -42,7 +42,7 @@ If \code{TRUE}, the package tests whether the directory is writable. } \examples{ -\dontshow{if (FALSE) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} +\dontshow{if (FALSE) withAutoprint(\{ # examplesIf} getOption("styler.ignore_alignment") options( styler.ignore_alignment = TRUE, diff --git a/man/validate_new_pos_ids.Rd b/man/validate_new_pos_ids.Rd index f2b1e22a4..3f8ab0722 100644 --- a/man/validate_new_pos_ids.Rd +++ b/man/validate_new_pos_ids.Rd @@ -19,9 +19,9 @@ x.5 and ids created with \code{after = FALSE} can have \code{pos_id} values betw reference to create the new \code{pos_ids}. } \seealso{ -Other token creators: -\code{\link{create_pos_ids}()}, -\code{\link{create_tokens}()} +Other token creators: +\code{\link[=create_pos_ids]{create_pos_ids()}}, +\code{\link[=create_tokens]{create_tokens()}} } \concept{token creators} \keyword{internal} diff --git a/man/visit.Rd b/man/visit.Rd index f2a757fc9..4fc0dfc35 100644 --- a/man/visit.Rd +++ b/man/visit.Rd @@ -30,8 +30,8 @@ before applying the functions (meaning it first applies the functions to the innermost level of nesting first and then going outwards). } \seealso{ -Other visitors: -\code{\link{visit_one}()} +Other visitors: +\code{\link[=visit_one]{visit_one()}} } \concept{visitors} \keyword{internal} diff --git a/man/visit_one.Rd b/man/visit_one.Rd index 7a3bdce6b..8ed15c5e2 100644 --- a/man/visit_one.Rd +++ b/man/visit_one.Rd @@ -16,7 +16,7 @@ Uses \code{\link[=Reduce]{Reduce()}} to apply each function of \code{funs} seque \code{pd_flat}. } \seealso{ -Other visitors: +Other visitors: \code{\link{visit}} } \concept{visitors} diff --git a/tests/testthat/line_breaks_fun_call/switch_ifelse_etc_no_line_break-in.R b/tests/testthat/line_breaks_fun_call/switch_ifelse_etc_no_line_break-in.R index 81caa6da5..9e5375acb 100644 --- a/tests/testthat/line_breaks_fun_call/switch_ifelse_etc_no_line_break-in.R +++ b/tests/testthat/line_breaks_fun_call/switch_ifelse_etc_no_line_break-in.R @@ -9,6 +9,11 @@ switch( y = 3 ) +# keep it on first line +switch(x, + a = 2, + y = 3 +) switch( # x, diff --git a/tests/testthat/line_breaks_fun_call/switch_ifelse_etc_no_line_break-out.R b/tests/testthat/line_breaks_fun_call/switch_ifelse_etc_no_line_break-out.R index 4c108e249..8d03f919e 100644 --- a/tests/testthat/line_breaks_fun_call/switch_ifelse_etc_no_line_break-out.R +++ b/tests/testthat/line_breaks_fun_call/switch_ifelse_etc_no_line_break-out.R @@ -3,11 +3,17 @@ call( 3 ) -switch(x, +switch( + x, a = 2, y = 3 ) +# keep it on first line +switch(x, + a = 2, + y = 3 +) switch( # x, @@ -16,18 +22,17 @@ switch( # ) -switch(x, +switch( + x, a = 2, # - y = 3 -) -switch(x, - a = 2, y = 3 ) -switch(x, + +switch( + x, a = 2, y = 3 ) @@ -37,14 +42,12 @@ switch(x, y = 3 ) -switch(x, - a = 2, - y = 3 -) # +switch(x, a = 2, y = 3) + +switch(x, a = 2, y = 3) # switch(x, - a = 2, - y = 3 # + a = 2, y = 3 # ) if_else(a, @@ -62,7 +65,8 @@ base::switch(f, y = 3 ) -base::switch(f, +base::switch( + f, x = 2, y = 3 ) diff --git a/tests/testthat/test-cache-high-level-api.R b/tests/testthat/test-cache-high-level-api.R index e645f8bc8..4240d7eec 100644 --- a/tests/testthat/test-cache-high-level-api.R +++ b/tests/testthat/test-cache-high-level-api.R @@ -134,7 +134,6 @@ test_that("speedup higher when cached roxygen example code is multiple expressio }) - test_that("no speedup when tranformer changes", { skip_on_cran() skip_on_covr() diff --git a/tests/testthat/test-indention_curly.R b/tests/testthat/test-indention_curly.R index 54b7821a9..95ca3367c 100644 --- a/tests/testthat/test-indention_curly.R +++ b/tests/testthat/test-indention_curly.R @@ -28,7 +28,6 @@ test_that("custom indention for curly braces is corretct ", { }) - test_that(paste( "complete styling via top-level api is correct", "(round, curly, spacing)" diff --git a/tests/testthat/test-indention_multiple.R b/tests/testthat/test-indention_multiple.R index aa1523bba..ebb12ecf1 100644 --- a/tests/testthat/test-indention_multiple.R +++ b/tests/testthat/test-indention_multiple.R @@ -27,7 +27,6 @@ test_that("multiple curly and round brackets don't cause extraindention", { }) - test_that("multiple curly and round brackets overall test", { expect_no_warning(test_collection("indention_multiple", "overall", diff --git a/tests/testthat/test-indention_round_brackets.R b/tests/testthat/test-indention_round_brackets.R index 9257810f1..a935676a8 100644 --- a/tests/testthat/test-indention_round_brackets.R +++ b/tests/testthat/test-indention_round_brackets.R @@ -17,8 +17,6 @@ test_that(paste("multi-line function call yields correct indention"), { ## ............................................................................ - - # Does NOT cover indention by operators such as +" test_that("arithmetic grouping with braces yields correctly indention", { diff --git a/tests/testthat/test-interaction-caching-stylerignore.R b/tests/testthat/test-interaction-caching-stylerignore.R index 255cb67a4..28b218d83 100644 --- a/tests/testthat/test-interaction-caching-stylerignore.R +++ b/tests/testthat/test-interaction-caching-stylerignore.R @@ -188,7 +188,6 @@ test_that("changing ignore markers invalidates cache", { }) - test_that("all expressions within a stylerignore sequence (whether cached or not) are put in the same block (low-level)", { transformers <- tidyverse_style() specs <- transformers$more_specs_style_guide diff --git a/tests/testthat/test-public_api-0.R b/tests/testthat/test-public_api-0.R index 70e90cbec..61d5485fd 100644 --- a/tests/testthat/test-public_api-0.R +++ b/tests/testthat/test-public_api-0.R @@ -27,7 +27,6 @@ test_that("styler can style package and exclude some sub-directories", { }) - test_that("styler can style package and exclude some directories and files", { capture_output(expect_true({ styled <- style_pkg(testthat_file("public-api", "xyzpackage"), diff --git a/tests/testthat/test-public_api-1.R b/tests/testthat/test-public_api-1.R index e7297d2dd..08bde5a6a 100644 --- a/tests/testthat/test-public_api-1.R +++ b/tests/testthat/test-public_api-1.R @@ -33,7 +33,6 @@ test_that("styler does not return error when there is no file to style", { }) - test_that("styler can style Rmd file", { expect_false({ out <- style_file( @@ -97,8 +96,6 @@ test_that("styler handles malformed Rmd file and invalid R code in chunk", { }) - - test_that("messages (via cat()) of style_file are correct", { for (encoding in ls_testable_encodings()) { withr::with_options( diff --git a/tests/testthat/test-public_api-2.R b/tests/testthat/test-public_api-2.R index 8606a4afd..1fbbbb635 100644 --- a/tests/testthat/test-public_api-2.R +++ b/tests/testthat/test-public_api-2.R @@ -32,7 +32,6 @@ test_that("styler can style .r and .rmd files only via style_dir()", { }) - test_that("styler can style R and Rmd files via style_pkg()", { msg <- capture_output( style_pkg(testthat_file("public-api", "xyzpackage-rmd"), diff --git a/tests/testthat/test-public_api-3.R b/tests/testthat/test-public_api-3.R index de74e8bfd..e0c832290 100644 --- a/tests/testthat/test-public_api-3.R +++ b/tests/testthat/test-public_api-3.R @@ -24,7 +24,6 @@ test_that("styler handles malformed Rnw file and invalid R code in chunk", { }) - test_that("styler can style R, Rmd and Rnw files via style_pkg()", { msg <- capture_output( style_pkg(testthat_file("public-api", "xyzpackage-rnw"), diff --git a/tests/testthat/test-token_adding_removing.R b/tests/testthat/test-token_adding_removing.R index 584f7f9b9..4dc94e0ca 100644 --- a/tests/testthat/test-token_adding_removing.R +++ b/tests/testthat/test-token_adding_removing.R @@ -36,7 +36,6 @@ test_that("braces only added to pipe if RHS is a symbol", { }) - test_that("No braces are added if conditional statement is within pipe", { expect_no_warning(test_collection("token_adding_removing", "else-pipe", transformer = style_text