Skip to content

Commit

Permalink
fix bug in cran_summary() (r-hub#261)
Browse files Browse the repository at this point in the history
  • Loading branch information
maelle authored May 2, 2019
1 parent 5180a33 commit d6b10b7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@

# dev

## Bug fixes

* `cran_summary()` now works even if there is a NOTE/WARNING/ERROR in one platform and nothing on other platforms (@fabian-s, #259).

# rhub 1.1.1

## Enhancements
Expand Down
11 changes: 9 additions & 2 deletions R/check-class.R
Original file line number Diff line number Diff line change
Expand Up @@ -248,14 +248,18 @@ check_cran_summary <- function(self, private) {

result <- do.call("rbind",
lapply(x, rectangle_status))

systems <- paste0("- R-hub ",
vapply(x, function(xx) xx$platform$name, ""),
" (",
vapply(x, function(xx) xx$platform$rversion, ""),
")")
lines <- paste0(systems, "\n")

if ("hash" %in% names(result)){

result <- result[!is.na(result$type),]

if (nrow(result) > 0){
message("For a CRAN submission we recommend that you fix all NOTEs, WARNINGs and ERRORs.")
unique_results <- unique(result[, c("type", "hash")])

Expand Down Expand Up @@ -326,7 +330,10 @@ rectangle_status <- function(x){
df <- df[df$message != "",]

if(nrow(df) == 0){
df <- data.frame(package = x$package)
df <- data.frame(package = x$package,
type = NA,
message = NA,
hash = NA)
} else{
df$hash <- hash_check(df$message)
}
Expand Down

0 comments on commit d6b10b7

Please sign in to comment.