Skip to content

Commit 324093e

Browse files
committed
remove default value from remove_custom_assign
1 parent 3a13c49 commit 324093e

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

R/utils-get_code_dependency.R

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,15 @@ fix_shifted_comments <- function(calls) {
150150
#' @param exclude (`character`) custom assignment operators to be excluded
151151
#' @keywords internal
152152
#' @noRd
153-
remove_custom_assign <- function(calls, exclude = c(":=")) {
153+
remove_custom_assign <- function(calls, exclude = NULL) {
154154
checkmate::assert_list(calls)
155-
checkmate::assert_character(exclude)
155+
checkmate::assert_character(exclude, null.ok = TRUE)
156156
lapply(calls, function(call) {
157-
call[!(call$token == "LEFT_ASSIGN" & call$text %in% exclude), ]
157+
if (!is.null(exclude)) {
158+
call[!(call$token == "LEFT_ASSIGN" & call$text %in% exclude), ]
159+
} else {
160+
call
161+
}
158162
})
159163
}
160164

0 commit comments

Comments
 (0)