Skip to content

Commit 00df531

Browse files
Update .ci/linters/rd/options_doc_check.R
Co-authored-by: Michael Chirico <[email protected]>
1 parent 06e4d00 commit 00df531

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

.ci/linters/rd/options_doc_check.R

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,14 @@ check_options_documentation = function(rd_file) {
3333
found = character(0)
3434
walk_rd = function(rd_element) {
3535
result = character(0)
36-
if (is.list(rd_element)) {
37-
if (!is.null(attr(rd_element, "Rd_tag")) && attr(rd_element, "Rd_tag") == "\\code" && length(rd_element) >= 1) {
38-
content = rd_element[[1]]
39-
if (is.character(content) && startsWith(content, "datatable.")) {
40-
result = content
41-
}
36+
if (!is.list(rd_element)) return(character())
37+
if (isTRUE(attr(rd_element, "Rd_tag") == "\\code") && length(rd_element) >= 1L) {
38+
content = rd_element[[1L]]
39+
if (is.character(content) && startsWith(content, "datatable.")) {
40+
result = content
4241
}
43-
result = c(result, unlist(lapply(rd_element, walk_rd)))
4442
}
45-
result
43+
c(result, unlist(lapply(rd_element, walk_rd)))
4644
}
4745
found = walk_rd(tools::parse_Rd(rd_file))
4846
sort(unique(found))

0 commit comments

Comments
 (0)