zeehio / condformat

Compare 9c9f195 ... +0 ... 5f9c428

No flags found

Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.

e.g., #unittest #integration

#production #enterprise

#frontend #backend

Learn more about Codecov Flags here.

Showing 1 of 2 files from the diff.
Other files ignored by Codecov

@@ -14,30 +14,30 @@
Loading
14 14
  if (!grepl(pattern = '\\.xlsx$', filename)) { # endsWith(filename, ".xlsx")
15 15
    filename <- paste0(filename, ".xlsx")
16 16
  }
17 -
17 +
  workbook <- NULL
18 18
  if (file.exists(filename) && identical(overwrite_wb, FALSE)) {
19 19
    if (identical(overwrite_sheet, FALSE)) {
20 20
      stop(paste0(
21 21
        "File ", filename, " already exists. Set overwrite_wb=TRUE ",
22 22
        "to overwrite the whole workbook or overwrite_sheet=TRUE to overwrite ",
23 23
        "just the the sheet ", sheet_name))
24 24
    }
25 -
    wb <- openxlsx::loadWorkbook(filename)
25 +
    workbook <- openxlsx::loadWorkbook(filename)
26 26
  } else {
27 -
    wb <- openxlsx::createWorkbook(creator = "")
27 +
    workbook <- openxlsx::createWorkbook(creator = "")
28 28
  }
29 29
30 -
  if (sheet_name %in% names(wb)) {
30 +
  if (sheet_name %in% names(workbook)) {
31 31
    if (overwrite_sheet) {
32 -
      openxlsx::removeWorksheet(wb = wb, sheet = sheet_name)
33 -
      openxlsx::addWorksheet(wb, sheetName = sheet_name)
32 +
      openxlsx::removeWorksheet(wb = workbook, sheet = sheet_name)
33 +
      openxlsx::addWorksheet(workbook, sheetName = sheet_name)
34 34
    }
35 35
  } else {
36 -
    openxlsx::addWorksheet(wb, sheetName = sheet_name)
36 +
    openxlsx::addWorksheet(workbook, sheetName = sheet_name)
37 37
  }
38 -
  condformat2excelsheet(x, wb, sheet_name)
38 +
  condformat2excelsheet(x, workbook, sheet_name)
39 39
  openxlsx::saveWorkbook(
40 -
    wb,
40 +
    workbook,
41 41
    file = filename,
42 42
    overwrite = overwrite_wb | overwrite_sheet
43 43
  )
@@ -52,12 +52,12 @@
Loading
52 52
# \dontrun{
53 53
# x <- condformat(iris[1:5,])
54 54
# library(openxlsx)
55 -
# wb <- openxlsx::createWorkbook(creator = "")
56 -
# openxlsx::addWorksheet(wb, sheetName = "sheet name")
57 -
# condformat2excelsheet(x, wb, "sheet name")
58 -
# openxlsx::saveWorkbook(wb, file = "iris.xlsx")
55 +
# workbook <- openxlsx::createWorkbook(creator = "")
56 +
# openxlsx::addWorksheet(workbook, sheetName = "sheet name")
57 +
# condformat2excelsheet(x, workbook, "sheet name")
58 +
# openxlsx::saveWorkbook(workbook, file = "iris.xlsx")
59 59
# }
60 -
condformat2excelsheet <- function(x, wb, sheet_name) {
60 +
condformat2excelsheet <- function(x, workbook, sheet_name) {
61 61
  xlsx_supported_rules <- c("rule_fill_discrete", "rule_fill_gradient",
62 62
                            "rule_fill_gradient2", "rule_text_bold", "rule_text_color")
63 63
@@ -78,7 +78,7 @@
Loading
78 78
  cf_fields <- xv_cf[["cf_fields"]]
79 79
  css_fields <- render_cf_fields_to_css_fields(cf_fields, xview)
80 80
81 -
  openxlsx::writeData(wb, sheet_name, as.data.frame(xview),
81 +
  openxlsx::writeData(workbook, sheet_name, as.data.frame(xview),
82 82
                      rowNames = FALSE, colNames = TRUE)
83 83
  created_styles <- list()
84 84
  # For each cell
@@ -120,10 +120,10 @@
Loading
120 120
        )
121 121
        created_styles[[style_hash]] <- cell_style
122 122
      }
123 -
      openxlsx::addStyle(wb, sheet_name, style = cell_style, rows = i + 1, cols = j)
123 +
      openxlsx::addStyle(workbook, sheet_name, style = cell_style, rows = i + 1, cols = j)
124 124
    }
125 125
  }
126 -
  openxlsx::setColWidths(wb, sheet = sheet_name, cols = seq_len(ncol(xview)), widths = "auto")
126 +
  openxlsx::setColWidths(workbook, sheet = sheet_name, cols = seq_len(ncol(xview)), widths = "auto")
127 127
  invisible(x)
128 128
}
129 129

Everything is accounted for!

No changes detected that need to be reviewed.
What changes does Codecov check for?
Lines, not adjusted in diff, that have changed coverage data.
Files that introduced coverage data that had none before.
Files that have missing coverage data that once were tracked.
Files Coverage
R 0.03% 73.55%
Project Totals (22 files) 73.55%
Loading