Skip to content

Commit

Permalink
Overdo importFrom
Browse files Browse the repository at this point in the history
I'll probably want to back off from this, won't I?
  • Loading branch information
jonthegeek committed Mar 28, 2024
1 parent c447587 commit b0ea1ba
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 10 deletions.
3 changes: 3 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ importFrom(cli,cli_abort)
importFrom(cli,cli_warn)
importFrom(desc,desc)
importFrom(dplyr,filter)
importFrom(fs,file_delete)
importFrom(fs,file_exists)
importFrom(fs,is_dir)
importFrom(fs,path)
importFrom(fs,path_dir)
Expand All @@ -23,6 +25,7 @@ importFrom(lubridate,now)
importFrom(lubridate,parse_date_time)
importFrom(nectar,call_api)
importFrom(nectar,stabilize_string)
importFrom(purrr,imap_chr)
importFrom(purrr,list_rbind)
importFrom(purrr,map)
importFrom(purrr,map2)
Expand Down
3 changes: 3 additions & 0 deletions R/beekeeper-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#' @importFrom cli cli_warn
#' @importFrom desc desc
#' @importFrom dplyr filter
#' @importFrom fs file_delete
#' @importFrom fs file_exists
#' @importFrom fs is_dir
#' @importFrom fs path
#' @importFrom fs path_dir
Expand All @@ -18,6 +20,7 @@
#' @importFrom lubridate parse_date_time
#' @importFrom nectar call_api
#' @importFrom nectar stabilize_string
#' @importFrom purrr imap_chr
#' @importFrom purrr list_rbind
#' @importFrom purrr map
#' @importFrom purrr map_chr
Expand Down
4 changes: 2 additions & 2 deletions R/generate_pkg-paths.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ NULL
}

.generate_paths_files <- function(paths_by_tag, api_abbr, security_data) {
paths_file_paths <- purrr::imap_chr(
paths_file_paths <- imap_chr(
paths_by_tag,
function(path_tag, path_tag_name) {
.generate_paths_file(path_tag, path_tag_name, api_abbr, security_data)
}
)
paths_test_paths <- purrr::imap_chr(
paths_test_paths <- imap_chr(
paths_by_tag,
function(path_tag, path_tag_name) {
.generate_paths_test_file(path_tag, path_tag_name, api_abbr)
Expand Down
10 changes: 5 additions & 5 deletions R/generate_pkg-prepare.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
if (.is_pkg(base_path)) {
return(invisible(NULL))
}
cli::cli_abort(c(
cli_abort(c(
"Can't generate package files outside of a package.",
x = "{.path {base_path}} is not inside a package."
))
Expand All @@ -22,16 +22,16 @@
#'
#' @return `TRUE` if the project is a package, `FALSE` if not.
#' @keywords internal
.is_pkg <- function(base_path = usethis::proj_get()) {
root_file <- rlang::try_fetch(
rprojroot::find_package_root_file(path = base_path),
.is_pkg <- function(base_path = proj_get()) {
root_file <- try_fetch(
find_package_root_file(path = base_path),
error = function(cnd) NULL
)
!is.null(root_file)
}

.read_config <- function(config_file = "_beekeeper.yml") {
config <- yaml::read_yaml(config_file)
config <- read_yaml(config_file)
config <- .stabilize_config(config)
return(config)
}
Expand Down
4 changes: 2 additions & 2 deletions R/generate_pkg-template.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
.bk_use_template_impl <- function(template, data, target, dir) {
target <- proj_path(dir, target)
save_as <- path_rel(target, proj_path())
if (fs::file_exists(target)) {
if (file_exists(target)) {
# TODO: Intelligently prompt about this.
fs::file_delete(target)
file_delete(target)
}
use_template(
template = template,
Expand Down
2 changes: 1 addition & 1 deletion man/dot-is_pkg.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b0ea1ba

Please sign in to comment.