From 9e259b9731887166709ead56d9318be1b6800578 Mon Sep 17 00:00:00 2001 From: mpadge Date: Mon, 26 Aug 2024 12:35:40 +0200 Subject: [PATCH] fix #41 --- DESCRIPTION | 2 +- R/roclet.R | 5 +++++ codemeta.json | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 9e47d12..219a709 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: srr Title: 'rOpenSci' Review Roclets -Version: 0.1.3.002 +Version: 0.1.3.003 Authors@R: person("Mark", "Padgham", , "mark@ropensci.org", role = c("aut", "cre"), comment = c(ORCID = "0000-0003-2172-5265")) diff --git a/R/roclet.R b/R/roclet.R index a55ef3a..58bd539 100644 --- a/R/roclet.R +++ b/R/roclet.R @@ -241,6 +241,11 @@ process_srrstats_tags <- function (block, fn_name = TRUE, dir = "R") { } ptn <- paste0 ("^.*", dir, "\\/") fpath <- regmatches (block$file, regexpr (ptn, block$file)) + if (length (fpath) == 0L) { + # Mostly only for 'tests/testthat.R' file, which should never have tags + # anyway, so is skipped here. + return (NULL) + } fpath_full <- gsub (fpath, paste0 (dir, "/"), block$file) msg <- paste0 ( diff --git a/codemeta.json b/codemeta.json index cc873dc..1c4ecee 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.002", + "version": "0.1.3.003", "programmingLanguage": { "@type": "ComputerLanguage", "name": "R",