Skip to content

Commit ed91a2f

Browse files
tidying code after latest run (#1984)
1 parent 6867390 commit ed91a2f

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

.dev/revdep_compare_releases.R

+14-8
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ library(glue)
77
if (!file.exists("revdep-repos")) {
88
stop("Please run .dev/revdep_get_repos.R first before running this")
99
}
10+
withr::local_options(width = 180)
1011
repo_data <- rbind(
1112
data.table::fread("revdep-repos"),
1213
# land after the initial lines of comments on the header line
@@ -24,7 +25,7 @@ if (length(failed_install) > 0L) {
2425

2526
dev_dir <- getwd()
2627
dev_branch <- system2("git", c("rev-parse", "--abbrev-ref", "HEAD"), stdout = TRUE)
27-
old_release <- "v2.0.1"
28+
old_release <- "v3.0.2"
2829
main <- "main"
2930

3031
all_repos <- repo_data$repo
@@ -208,7 +209,7 @@ summarize_lint_delta <- function(new, old) {
208209
][, .(line = sprintf("%s [%s]", line, linter), location = paste0(package, ":", filename))
209210
][, print(.SD)]
210211

211-
NULL
212+
invisible()
212213
}
213214

214215
# ---- Main linting execution ----
@@ -229,12 +230,17 @@ main_only <- setdiff(basename(main_results), basename(old_results))
229230
old_only <- setdiff(basename(old_results), basename(main_results))
230231
shared <- intersect(basename(main_results), basename(old_results))
231232

232-
message("The following packages warned on ", main, " only: ")
233-
message(" ", toString(match_and_strip(main_only, "\\.warnings$")), "\n")
234-
message("The following packages warned on ", old_release, " only: ")
235-
message(" ", toString(match_and_strip(old_only, "\\.warnings$")), "\n")
236-
message("The following packages warned on both branches: ")
237-
message(" ", toString(match_and_strip(shared, "\\.warnings$")), "\n")
233+
summarize_warned <- function(warned, label) {
234+
message("The following packages warned on ", label, ":")
235+
if (length(warned) > 0) {
236+
message(" ", toString(match_and_strip(warned, "\\.warnings$")), "\n")
237+
} else {
238+
message(" None! 🎉")
239+
}
240+
}
241+
summarize_warned(main_only, "main only")
242+
summarize_warned(old_only, paste(old_release, "only"))
243+
summarize_warned(shared, "both branches")
238244

239245
main_only <- grep("warnings$", main_only, invert = TRUE, value = TRUE)
240246
old_only <- grep("warnings$", old_only, invert = TRUE, value = TRUE)

0 commit comments

Comments
 (0)