Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/github_actions/actions/checkout-4
Browse files Browse the repository at this point in the history
  • Loading branch information
IndrajeetPatil authored Sep 11, 2023
2 parents 9b31d04 + 082603d commit c691c6f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion R/rules-indention.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ indent_braces <- function(pd, indent_by) {
#' @keywords internal
unindent_fun_dec <- function(pd, indent_by = 2L) {
if (is_function_declaration(pd)) {
idx_closing_brace <- which(pd$token %in% "')'")
idx_closing_brace <- which(pd$token == "')'")
fun_dec_head <- seq2(2L, idx_closing_brace)
if (is_double_indent_function_declaration(pd, indent_by = indent_by)) {
pd$indent[fun_dec_head] <- 2L * indent_by
Expand Down
1 change: 0 additions & 1 deletion R/rules-line-breaks.R
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ style_line_break_around_curly <- function(strict, pd) {
closing_before <- pd$token == "'}'"
opening_before <- (pd$token == "'{'")
to_break <- lag(opening_before, default = FALSE) | closing_before
len_to_break <- sum(to_break)
pd$lag_newlines[to_break] <- ifelse(
pd$token[to_break] == "COMMENT",
pmin(1L, pd$lag_newlines[to_break]),
Expand Down
9 changes: 5 additions & 4 deletions R/transform-files.R
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,12 @@ make_transformer <- function(transformers,
use_cache <- FALSE
}

if (!use_cache) {
if (use_cache) {
text
} else {
transformed_code <- text %>%
parse_transform_serialize_r(transformers,
parse_transform_serialize_r(
transformers,
base_indention = base_indention,
warn_empty = warn_empty
)
Expand All @@ -139,8 +142,6 @@ make_transformer <- function(transformers,
}

transformed_code
} else {
text
}
}
}
Expand Down

0 comments on commit c691c6f

Please sign in to comment.