metrumresearchgroup / review

helpful tools for organizing and performing quality control (QC) tasks
https://metrumresearchgroup.github.io/review/
2 stars 0 forks source link

Add warning message when user has modified file since last QC #61

Closed michaelmcd18 closed 5 months ago

andersone1 commented 5 months ago

@michaelmcd18 Can we make this minor change:

from:

  if (Sys.info()[["user"]] %in% authors_last_qc) {
    cli::cli_alert_warning("User has modified file since last QC")
  }

to:

this_user <- Sys.info()[["user"]]

if (this_user %in% authors_last_qc) {
   cli::cli_alert_warning(glue::glue("'{this_user}' has modified '{basename(.file)}' since last QC"))
}
andersone1 commented 5 months ago

@michaelmcd18 The test will need to slightly change:

from:

expect_message(diffQced(file1), "User has modified file since last QC")

to:

this_test_user <- Sys.info()[["user"]]
expect_message(diffQced(file1), glue::glue("'{this_test_user}' has modified '{basename(file1)}' since last QC"))