Skip to content

Commit 9cf8d9d

Browse files
authored
Merge pull request #52 from ropensci-review-tools/pre-sub
return compliance statement from pre_sub fn #51
2 parents 4b0e2ca + bdc5843 commit 9cf8d9d

File tree

4 files changed

+18
-7
lines changed

4 files changed

+18
-7
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: srr
22
Title: 'rOpenSci' Review Roclets
3-
Version: 0.1.4.002
3+
Version: 0.1.4.004
44
Authors@R:
55
person("Mark", "Padgham", , "mark@ropensci.org", role = c("aut", "cre"),
66
comment = c(ORCID = "0000-0003-2172-5265"))

R/pre-submit.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ srr_stats_pre_submit <- function (path = ".", quiet = FALSE) {
7474
for (s in compliance_statement) {
7575
cli::cli_alert_warning (s)
7676
}
77+
msg <- c (msg, compliance_statement)
7778
}
7879

7980
invisible (msg)

codemeta.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"codeRepository": "https://github.com/ropensci-review-tools/srr",
99
"issueTracker": "https://github.com/ropensci-review-tools/srr/issues",
1010
"license": "https://spdx.org/licenses/MIT",
11-
"version": "0.1.4.002",
11+
"version": "0.1.4.004",
1212
"programmingLanguage": {
1313
"@type": "ComputerLanguage",
1414
"name": "R",

tests/testthat/test-release.R

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,34 @@ test_that ("release", {
1212
file.remove (file.path (d, "README.Rmd"))
1313

1414
x <- utils::capture.output (
15-
srr_stats_pre_submit (d),
15+
rep <- srr_stats_pre_submit (d),
1616
type = "message"
1717
)
1818
expect_true (length (x) > 100) # > 100 standards are missing
1919

20-
errs <- grep ("^\\!", x)
21-
expect_length (errs, 4L)
20+
errs_output <- grep ("^\\!", x)
21+
expect_length (errs_output, 4L)
22+
# Report has error text only, no symbols or exclamations:
23+
errs_rep <- grep ("^\\!", rep)
24+
expect_length (errs_rep, 0L)
2225

2326
msg <- "package still has TODO standards and can not be submitted"
2427
expect_length (grep (msg, x), 1L)
28+
expect_length (grep (msg, rep), 1L)
2529
msg <- "the following standards (.*) are missing from your code"
2630
expect_length (grep (msg, x), 1L)
31+
expect_length (grep (msg, rep), 1L)
2732

2833
msg <- "must comply with at least 50% of all standards"
2934
expect_length (grep (msg, x), 1L)
35+
expect_length (grep (msg, rep), 1L)
3036
msg <- "must comply with at least 50% of category-specific standards"
3137
expect_length (grep (msg, x), 1L)
38+
expect_length (grep (msg, rep), 1L)
3239

33-
missing_stds <- grep ("^[0-9]+", x)
34-
expect_true (length (missing_stds) > 100L)
40+
missing_stds_output <- grep ("^[0-9]+", x)
41+
missing_stds_rep <- grep ("[A-Z][0-9]+\\.[0-9]", rep, value = T)
42+
expect_true (length (missing_stds_output) > 100L)
43+
expect_true (length (missing_stds_rep) > 100L)
44+
expect_equal (length (missing_stds_output), length (missing_stds_rep))
3545
})

0 commit comments

Comments
 (0)