Skip to content

Commit

Permalink
fix get_stds_in_code to traverse all dirs for #24
Browse files Browse the repository at this point in the history
  • Loading branch information
mpadge committed Nov 26, 2021
1 parent 36ecc5c commit cb5ccdb
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: srr
Title: 'rOpenSci' Review Roclets
Version: 0.0.1.142
Version: 0.0.1.143
Authors@R:
person("Mark", "Padgham", , "mark@ropensci.org", role = c("aut", "cre"),
comment = c(ORCID = "0000-0003-2172-5265"))
Expand Down
15 changes: 13 additions & 2 deletions R/pre-submit.R
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,21 @@ get_stds_from_code <- function (path) {
return (NULL)
}

flist <- list.files (file.path (path, "R"), full.names = TRUE)
dirs <- c (".", "R", "vignettes", "tests")
sfxs <- c ("\\.Rmd$", "\\.(R|r)$", "\\.Rmd$", "\\.(R|r)$")
rec <- c (FALSE, FALSE, TRUE, TRUE)

flist <- lapply (seq_along (dirs), function (i) {
list.files (file.path (path, dirs [i]),
full.names = TRUE,
recursive = rec [i],
pattern = sfxs [i])
})
flist <- unlist (flist)

suppressWarnings ({
blocks <- lapply (flist, function (i)
tryCatch (roxygen2::parse_file (i),
tryCatch (roxygen2::parse_file (i, env = NULL),
error = function (e) list ()))
})
names (blocks) <- flist
Expand Down
2 changes: 1 addition & 1 deletion codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"description": "Companion package to 'rOpenSci' statistical software review\n project.",
"name": "srr: 'rOpenSci' Review Roclets",
"license": "https://spdx.org/licenses/MIT",
"version": "0.0.1.142",
"version": "0.0.1.143",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "R",
Expand Down

0 comments on commit cb5ccdb

Please sign in to comment.