Skip to content

Commit 25992d8

Browse files
Clean new lints
1 parent 1976817 commit 25992d8

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

R/rules-indention.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ indent_braces <- function(pd, indent_by) {
2020
#' @keywords internal
2121
unindent_fun_dec <- function(pd, indent_by = 2L) {
2222
if (is_function_declaration(pd)) {
23-
idx_closing_brace <- which(pd$token %in% "')'")
23+
idx_closing_brace <- which(pd$token == "')'")
2424
fun_dec_head <- seq2(2L, idx_closing_brace)
2525
if (is_double_indent_function_declaration(pd, indent_by = indent_by)) {
2626
pd$indent[fun_dec_head] <- 2L * indent_by

R/rules-line-breaks.R

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,6 @@ style_line_break_around_curly <- function(strict, pd) {
153153
closing_before <- pd$token == "'}'"
154154
opening_before <- (pd$token == "'{'")
155155
to_break <- lag(opening_before, default = FALSE) | closing_before
156-
len_to_break <- sum(to_break)
157156
pd$lag_newlines[to_break] <- ifelse(
158157
pd$token[to_break] == "COMMENT",
159158
pmin(1L, pd$lag_newlines[to_break]),

R/transform-files.R

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,12 @@ make_transformer <- function(transformers,
116116
use_cache <- FALSE
117117
}
118118

119-
if (!use_cache) {
119+
if (use_cache) {
120+
text
121+
} else {
120122
transformed_code <- text %>%
121-
parse_transform_serialize_r(transformers,
123+
parse_transform_serialize_r(
124+
transformers,
122125
base_indention = base_indention,
123126
warn_empty = warn_empty
124127
)
@@ -139,8 +142,6 @@ make_transformer <- function(transformers,
139142
}
140143

141144
transformed_code
142-
} else {
143-
text
144145
}
145146
}
146147
}

0 commit comments

Comments
 (0)