Skip to content

Instantly share code, notes, and snippets.

@EmilHvitfeldt
Created September 19, 2024 20:32
Show Gist options
  • Save EmilHvitfeldt/13530c687cbd7975e4ac51fb1f9ddc49 to your computer and use it in GitHub Desktop.
Save EmilHvitfeldt/13530c687cbd7975e4ac51fb1f9ddc49 to your computer and use it in GitHub Desktop.
find untested cli code in R package
library(tidyverse)
res_tbl <- covr::package_coverage() |>
purrr::map(~tibble(
value = if_else(is.null(.x$value), NA, .x$value),
code = as.character(.x$srcref)
)) |>
purrr::list_rbind(names_to = "file")
res_tbl |>
filter(value == 0, str_detect(code, "(cli_abort|cli_warn|cli_inform)")) |>
arrange(file)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment