Skip to content

Commit

Permalink
tidying code after latest run (#1984)
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelChirico authored Jun 29, 2023
1 parent 6867390 commit ed91a2f
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions .dev/revdep_compare_releases.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ library(glue)
if (!file.exists("revdep-repos")) {
stop("Please run .dev/revdep_get_repos.R first before running this")
}
withr::local_options(width = 180)
repo_data <- rbind(
data.table::fread("revdep-repos"),
# land after the initial lines of comments on the header line
Expand All @@ -24,7 +25,7 @@ if (length(failed_install) > 0L) {

dev_dir <- getwd()
dev_branch <- system2("git", c("rev-parse", "--abbrev-ref", "HEAD"), stdout = TRUE)
old_release <- "v2.0.1"
old_release <- "v3.0.2"
main <- "main"

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

NULL
invisible()
}

# ---- Main linting execution ----
Expand All @@ -229,12 +230,17 @@ main_only <- setdiff(basename(main_results), basename(old_results))
old_only <- setdiff(basename(old_results), basename(main_results))
shared <- intersect(basename(main_results), basename(old_results))

message("The following packages warned on ", main, " only: ")
message(" ", toString(match_and_strip(main_only, "\\.warnings$")), "\n")
message("The following packages warned on ", old_release, " only: ")
message(" ", toString(match_and_strip(old_only, "\\.warnings$")), "\n")
message("The following packages warned on both branches: ")
message(" ", toString(match_and_strip(shared, "\\.warnings$")), "\n")
summarize_warned <- function(warned, label) {
message("The following packages warned on ", label, ":")
if (length(warned) > 0) {
message(" ", toString(match_and_strip(warned, "\\.warnings$")), "\n")
} else {
message(" None! 🎉")
}
}
summarize_warned(main_only, "main only")
summarize_warned(old_only, paste(old_release, "only"))
summarize_warned(shared, "both branches")

main_only <- grep("warnings$", main_only, invert = TRUE, value = TRUE)
old_only <- grep("warnings$", old_only, invert = TRUE, value = TRUE)
Expand Down

0 comments on commit ed91a2f

Please sign in to comment.