Skip to content

Commit

Permalink
catch reported stds which do not exist; closes #25
Browse files Browse the repository at this point in the history
  • Loading branch information
mpadge committed Nov 26, 2021
1 parent cb5ccdb commit fafd279
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 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.143
Version: 0.0.1.144
Authors@R:
person("Mark", "Padgham", , "[email protected]", role = c("aut", "cre"),
comment = c(ORCID = "0000-0003-2172-5265"))
Expand Down
12 changes: 12 additions & 0 deletions R/pre-submit.R
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ srr_stats_pre_submit <- function (path = ".", quiet = FALSE) {
all_stds <- unlist (lapply (categories$category, get_standard_nums))

index <- which (!all_stds %in% unique (unlist (stds_in_code)))
index_not <- which (!unique (unlist (stds_in_code)) %in% all_stds)
if (length (index) > 0) {
msg1 <- paste0 ("Package can not be submitted because the ",
"following standards [v",
Expand All @@ -66,6 +67,17 @@ srr_stats_pre_submit <- function (path = ".", quiet = FALSE) {
"",
all_stds [index],
"")
} else if (length (index_not) > 0L) {

# issue#25
not_a_std <- unique (unlist (stds_in_code)) [index_not]
msg <- "Your code includes the following standard"
if (length (not_a_std) > 1L) {
msg <- paste0 (msg, "s")
}
msg <- paste0 (msg, " which are not actual standards: [",
not_a_std, "]")

} else if (length (stds_in_code$stds_todo) == 0) {


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.143",
"version": "0.0.1.144",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "R",
Expand Down

0 comments on commit fafd279

Please sign in to comment.