We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3a13c49 commit 324093eCopy full SHA for 324093e
R/utils-get_code_dependency.R
@@ -150,11 +150,15 @@ fix_shifted_comments <- function(calls) {
150
#' @param exclude (`character`) custom assignment operators to be excluded
151
#' @keywords internal
152
#' @noRd
153
-remove_custom_assign <- function(calls, exclude = c(":=")) {
+remove_custom_assign <- function(calls, exclude = NULL) {
154
checkmate::assert_list(calls)
155
- checkmate::assert_character(exclude)
+ checkmate::assert_character(exclude, null.ok = TRUE)
156
lapply(calls, function(call) {
157
- call[!(call$token == "LEFT_ASSIGN" & call$text %in% exclude), ]
+ if (!is.null(exclude)) {
158
+ call[!(call$token == "LEFT_ASSIGN" & call$text %in% exclude), ]
159
+ } else {
160
+ call
161
+ }
162
})
163
}
164
0 commit comments