Skip to content

Commit c0a7535

Browse files
committed
fix test-coverage metric when no codecov badge
1 parent ac7ae31 commit c0a7535

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

DESCRIPTION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: repometrics
22
Title: Metrics for Your Code Repository
3-
Version: 0.2.0
3+
Version: 0.2.0.001
44
Authors@R:
55
person("Mark", "Padgham", , "mark.padgham@email.com", role = c("aut", "cre"),
66
comment = c(ORCID = "0000-0003-2172-5265"))

R/cm-metric-test-coverage.R

+3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ cm_data_test_coverage <- function (path, end_date = NULL) {
1111

1212
readme <- readr::read_lines (readme, progress = FALSE)
1313
codecov <- grep ("codecov\\.io.*\\.svg", readme, value = TRUE)
14+
if (length (codecov) == 0L) {
15+
return (NA_real_)
16+
}
1417
ptn <- "https\\:.*\\.svg"
1518
badge_svg <- regmatches (codecov, gregexpr (ptn, codecov)) [[1]]
1619
# Have to use httr2 to enable mocking via httptest2:

codemeta.json

+11-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"codeRepository": "https://github.com/ropensci-review-tools/repometrics",
99
"issueTracker": "https://github.com/ropensci-review-tools/repometrics/issues",
1010
"license": "https://spdx.org/licenses/GPL-3.0",
11-
"version": "0.2.0",
11+
"version": "0.2.0.001",
1212
"programmingLanguage": {
1313
"@type": "ComputerLanguage",
1414
"name": "R",
@@ -331,11 +331,18 @@
331331
"name": "pkgstats",
332332
"sameAs": "https://github.com/ropensci-review-tools/pkgstats"
333333
},
334-
"SystemRequirements": null
334+
"SystemRequirements": {}
335335
},
336336
"fileSize": "24739.199KB",
337337
"readme": "https://github.com/ropensci-review-tools/repometrics/blob/main/README.md",
338-
"contIntegration": ["https://github.com/ropensci-review-tools/repometrics/actions?query=workflow%3AR-CMD-check", "https://app.codecov.io/gh/ropensci-review-tools/repometrics"],
338+
"contIntegration": [
339+
"https://github.com/ropensci-review-tools/repometrics/actions?query=workflow%3AR-CMD-check",
340+
"https://app.codecov.io/gh/ropensci-review-tools/repometrics"
341+
],
339342
"developmentStatus": "https://www.repostatus.org/#active",
340-
"keywords": ["dashboard", "r", "software-metrics"]
343+
"keywords": [
344+
"dashboard",
345+
"r",
346+
"software-metrics"
347+
]
341348
}

0 commit comments

Comments
 (0)