Skip to content

Commit 4262ce8

Browse files
chng if to else if and _ast to _for_dt_optopns
1 parent 00df531 commit 4262ce8

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

.ci/linters/rd/options_doc_check.R

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,18 @@ check_options_documentation = function(rd_file) {
66
get_options_from_code = function() {
77
found = character(0)
88

9-
walk_ast = function(expr) {
9+
walk_for_dt_options = function(expr) {
1010
result = character(0)
1111
if (is.call(expr) && length(expr) >= 2 && identical(expr[[1]], quote(getOption)) && is.character(expr[[2]]) && startsWith(expr[[2]], "datatable.")) {
1212
result = expr[[2]]
13-
}
14-
if (is.recursive(expr)) {
15-
result = c(result, unlist(lapply(expr, walk_ast)))
13+
} else if (is.recursive(expr)) {
14+
result = c(result, unlist(lapply(expr, walk_for_dt_options)))
1615
}
1716
result
1817
}
1918
r_files = list.files("R", pattern = "\\.R$", full.names = TRUE)
2019
for (file in r_files) {
21-
tryCatch({
22-
found = c(found, unlist(lapply(parse(file = file), walk_ast)))
23-
}, error = function(e) {})
20+
found = c(found, unlist(lapply(parse(file = file), walk_for_dt_options)))
2421
}
2522
sort(unique(found))
2623
}

0 commit comments

Comments
 (0)