Skip to content

Commit

Permalink
prepended_checklist_note
Browse files Browse the repository at this point in the history
  • Loading branch information
jenna-a2ai committed Nov 18, 2024
1 parent dccb3e3 commit ef9c7e9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 18 deletions.
16 changes: 16 additions & 0 deletions R/custom_options.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,22 @@ get_checklist_display_name_var <- function(capitalized = FALSE, plural = FALSE)
return(checklist_display_name_var)
}

get_prepended_checklist_note <- function() {
prepended_checklist_note <- .le$prepended_checklist_note

# if not given, make the empty string
if (is.null(prepended_checklist_note)) {
prepended_checklist_note <- ""
}

# if given, append with a newline
else {
prepended_checklist_note <- paste0(prepended_checklist_note, "\n")
}

return(prepended_checklist_note)
}

# get_dne_var <- function(capitalized = FALSE) {
# dne_var <- .le$dne_var
#
Expand Down
19 changes: 1 addition & 18 deletions R/format.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ format_issue_body <- function(checklist_type, file_path) {
file_items <- checklists[[checklist_type]]
qc_checklist <- format_checklist_items(file_items)
metadata <- format_metadata(checklist_type, file_path)
note <- format_note()
note <- get_prepended_checklist_note()

issue_body_content <- format_body_content(metadata = metadata,
checklist_type = checklist_type,
Expand Down Expand Up @@ -180,23 +180,6 @@ get_file_contents_url <- function(file_path, git_sha) {
file.path(https_url, "blob", substr(git_sha, 1, 6), file_path)
}

format_note <- function() {
note <- {
if (file.exists(file.path(.le$info_repo_path, "note"))) {
custom_note <- readr::read_file(file.path(.le$info_repo_path, "note"))
if (stringr::str_sub(custom_note, start =-2) != "\n") {
custom_note <- paste0(custom_note,"\n")
}
custom_note
}
else {
""
}
}

return(note)
}

format_body_content <- function(metadata, checklist_type, note, qc_checklist) {
glue::glue("## Metadata\n\n
{metadata}\n\n
Expand Down

0 comments on commit ef9c7e9

Please sign in to comment.