diff --git a/DESCRIPTION b/DESCRIPTION index be3e32d..64fa769 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: srr Title: 'rOpenSci' Review Roclets -Version: 0.1.3.013 +Version: 0.1.3.014 Authors@R: person("Mark", "Padgham", , "mark@ropensci.org", role = c("aut", "cre"), comment = c(ORCID = "0000-0003-2172-5265")) diff --git a/R/report.R b/R/report.R index d7aa845..98c5fb9 100644 --- a/R/report.R +++ b/R/report.R @@ -349,7 +349,7 @@ one_msg_to_markdown <- function (m, remote, branch, std_txt) { fn <- NA_character_ if (grepl ("\\sfunction\\s", m)) { g <- gregexpr ("\\sfunction\\s+\\'.*\\'", m) - fn <- gsub ("^\\sfunction\\s+\\'|\\'$", "", regmatches (m, g) [[1]]) + fn <- gsub ("^\\sfunction\\s+\\'|\\'$", " ", regmatches (m, g) [[1]]) } g <- gregexpr ("file\\s+\\[.*\\]$", m) diff --git a/R/roclet.R b/R/roclet.R index 8472153..d6721d9 100644 --- a/R/roclet.R +++ b/R/roclet.R @@ -237,6 +237,15 @@ process_srrstats_tags <- function (tag = "srrstats", block, msg <- paste0 ("[", paste0 (snum, collapse = ", "), "]") if (fn_name) { func_name <- block$object$alias + if (is.null (func_name)) { + pd <- utils::getParseData (parse (text = deparse (block$call))) + pd <- pd [-(which (pd$token == "expr")), ] + if (pd$token [1] == "SYMBOL" && + pd$token [2] == "LEFT_ASSIGN" && + pd$token [3] == "FUNCTION") { + func_name <- pd$text [1] + } + } if (!is.null (func_name)) { msg <- paste0 (msg, " in function '", func_name, "()'") } diff --git a/codemeta.json b/codemeta.json index d9ede62..f473954 100644 --- a/codemeta.json +++ b/codemeta.json @@ -8,7 +8,7 @@ "codeRepository": "https://github.com/ropensci-review-tools/srr", "issueTracker": "https://github.com/ropensci-review-tools/srr/issues", "license": "https://spdx.org/licenses/MIT", - "version": "0.1.3.013", + "version": "0.1.3.014", "programmingLanguage": { "@type": "ComputerLanguage", "name": "R",