From c04af404a859a44d6af09651e6056744ae712735 Mon Sep 17 00:00:00 2001 From: Anna Krystalli Date: Wed, 27 Sep 2023 13:50:00 +0300 Subject: [PATCH] Include message when PR contains commits to files not checked. Related to #35 --- R/validate_pr.R | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/R/validate_pr.R b/R/validate_pr.R index 0d79dba4..f3e190a3 100644 --- a/R/validate_pr.R +++ b/R/validate_pr.R @@ -69,6 +69,16 @@ validate_pr <- function(hub_path = ".", gh_repo, pr_number, validations <<- c(validations, list(e)) }) + validated_files <- c(model_output_files, model_metadata_files) + if (length(pr_filenames) != length(validated_files)) { + validated_idx <- purrr::map_int(validated_files, + ~grep(.x, pr_files, fixed = TRUE) + ) + cli::cli_inform( + "PR contains commits to additional files which have not been checked: + {.val {pr_filenames[-validated_idx]}}.") + } + class(validations) <- c("hub_validations", "list") return(validations) }