Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: CJ Yetman <[email protected]>
  • Loading branch information
AlexAxthelm and cjyetman authored Jun 28, 2024
1 parent c9703c4 commit 2d875e9
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions R/get_csv_specs.R
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,7 @@ get_csv_specs <- function(files, expected_colnames = c("Investor.Name", "Portfol
if (all(!is.na(files_df$decimal_mark)) && all(files_df$decimal_mark == ".")) {
cli::cli_alert_success(paste0("all files use {.strong ", cli::style_inverse("."), "} for a decimal mark"))
} else {
alert_files <- c(
files_df$filename[is.na(files_df$decimal_mark)],
files_df$filename[grepl("^[,]$", files_df$decimal_mark)]
)
alert_files <- files_df$filename[is.na(files_df$decimal_mark) | grepl("^[.]$", files_df$decimal_mark)]
report_alert_files(paste0("the following files do not use {.strong ", cli::style_inverse("."), "} for a decimal mark"), alert_files, type = "warning", info = "this can be adapted to automatically by the {.fun read_portfolio_csv} function")
}

Expand All @@ -205,10 +202,7 @@ get_csv_specs <- function(files, expected_colnames = c("Investor.Name", "Portfol
if (all(!is.na(files_df$grouping_mark)) && all(files_df$grouping_mark == ",")) {
cli::cli_alert_success(paste0("all files use {.strong ", cli::style_inverse(","), "} for a grouping mark"))
} else {
alert_files <- c(
files_df$filename[is.na(files_df$grouping_mark)],
files_df$filename[grepl("^[,]$", files_df$grouping_mark)]
)
alert_files <- files_df$filename[is.na(files_df$grouping_mark) | grepl("^[,]$", files_df$grouping_mark)]
report_alert_files(paste0("the following files do not use {.strong ", cli::style_inverse(","), "} for a grouping mark"), alert_files, type = "warning", info = "this can be adapted to automatically by the {.fun read_portfolio_csv} function")
}

Expand Down

0 comments on commit 2d875e9

Please sign in to comment.