Skip to content

Commit

Permalink
Fixes packages with no URL listed in description
Browse files Browse the repository at this point in the history
  • Loading branch information
shikokuchuo committed Mar 5, 2024
1 parent 3cad892 commit d9be80f
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 2 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: r.releases.utils
Title: Utilities for An R Universe of Package Releases
Description: Utilities for an R universe of package releases.
Version: 0.0.8
Version: 0.0.8.9000
License: MIT + file LICENSE
URL:
https://r-releases.github.io/r.releases.utils/,
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# r.releases.utils 0.0.8.9000 (development)

* Makes `review_pull_requests()` robust to a package description with no URL listed.

# r.releases.utils 0.0.8

* Use R-releases and not `r-releases` to refer to the project.
Expand Down
8 changes: 7 additions & 1 deletion R/assert_cran_url.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,13 @@ assert_cran_url <- function(name, url) {
return(invisible())
}
package <- result[["Package"]]
main_urls <- strsplit(result[["URL"]], ",\n|, |\n", perl = TRUE)[[1L]]
main_urls <- unlist(
strsplit(
as.character(result[["URL"]]),
",\n|, |\n",
perl = TRUE
)
)
bugs_url <- sub(
pattern = "/issues/*$",
replacement = "",
Expand Down
11 changes: 11 additions & 0 deletions tests/test-assert_package.R
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,17 @@ stopifnot(
)
)

stopifnot(
grepl(
"does not appear in its DESCRIPTION file published on CRAN",
r.releases.utils::assert_cran_url(
name = "assertthat",
url = "https://github.com/hadley/assertthat"
),
fixed = TRUE
)
)

stopifnot(
grepl(
"returned HTTP error",
Expand Down

0 comments on commit d9be80f

Please sign in to comment.