diff --git a/DESCRIPTION b/DESCRIPTION index d6a2121..c17a415 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: checked Title: Systematically Run R CMD Checks -Version: 0.2.7 +Version: 0.2.8 Authors@R: c( person( diff --git a/NEWS.md b/NEWS.md index a65bd51..44b2e40 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,8 @@ +# checked 0.2.8 + +* Unify notes, warnings and errors are internally stored when generating + results (R4.5 compatibility) + # checked 0.2.7 * Fix a bug where wrong lib.loc was used to derive whether a package has already diff --git a/R/results.R b/R/results.R index 975b5ad..4fefc2c 100644 --- a/R/results.R +++ b/R/results.R @@ -98,11 +98,13 @@ results.revdep_check_task_spec <- function(x, y, output, ...) { structure( lapply(CHECK_ISSUES_TYPES, function(i) { new_i <- structure( - new[[i]], + # If no issues identified, object is an empty list instead of a character + # vector. Changing it to empty character for consistency. + if (is.list(new[[i]])) character(0) else new[[i]], names = get_issue_header(new[[i]]) ) old_i <- structure( - old[[i]], + if (is.list(old[[i]])) character(0) else old[[i]], names = get_issue_header(old[[i]]) ) @@ -373,10 +375,22 @@ print.potential_issues <- function(x, ...) { } strip_details_from_issue <- function(x) { - x <- gsub("See(.*?)for details", "See for details", "", x) - gsub("[[:space:]]", "", x) + x <- gsub( + x = x, + pattern = "See(.*?)for details", + replacement = "See for details" + ) + gsub( + x = x, + pattern = "[[:space:]]", + replacement = "" + ) } collapse_new_lines <- function(x) { - gsub("(\\n\\s*){2,}", "\n\n", x) + gsub( + x = x, + pattern = "(\\n\\s*){2,}", + replacement = "\n\n", + ) } diff --git a/R/task_graph.R b/R/task_graph.R index 1d08fd9..52ccff8 100644 --- a/R/task_graph.R +++ b/R/task_graph.R @@ -211,7 +211,7 @@ task_graph_sort <- function(g) { # use only strong dependencies to prioritize by topology (leafs first) strong_edges <- igraph::E(g)[igraph::E(g)$type %in% DEP_STRONG] - g_strong <- igraph::subgraph.edges(g, strong_edges, delete.vertices = FALSE) + g_strong <- igraph::subgraph_from_edges(g, strong_edges, delete.vertices = FALSE) topo <- igraph::topo_sort(g_strong, mode = "in") priority_topo <- integer(length(g)) priority_topo[match(topo$name, igraph::V(g)$name)] <- rev(seq_along(topo))