Skip to content

Commit

Permalink
[load] silence warning on "[trash]" folder. closes #1012 (#1013)
Browse files Browse the repository at this point in the history
* [load] silence warning on "[trash]" folder

* update NEWS
  • Loading branch information
JanMarvin committed May 7, 2024
1 parent dba5b7d commit 921afc3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
4 changes: 3 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

## New features

* remove conditional formatting from worksheet
* Add function to remove conditional formatting from worksheet `wb_remove_conditional_formatting()` [1011](https://github.com/JanMarvin/openxlsx2/pull/1011)

* Silence a warning triggered by a folder called `"[trash]"`. [1012](https://github.com/JanMarvin/openxlsx2/pull/1012)


***************************************************************************
Expand Down
2 changes: 1 addition & 1 deletion R/wb_load.R
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ wb_load <- function(
"customXml", "docProps", "drawings", "embeddings", "externalLinks",
"media", "persons", "pivotCache", "pivotTables", "printerSettings",
"queryTables", "richData", "slicerCaches", "slicers", "tables", "theme",
"threadedComments", "worksheets", "xl"
"threadedComments", "worksheets", "xl", "[trash]"
)
unknown <- file_folders[!file_folders %in% known]
# nocov start
Expand Down
7 changes: 7 additions & 0 deletions tests/testthat/test-loading_workbook.R
Original file line number Diff line number Diff line change
Expand Up @@ -490,3 +490,10 @@ test_that("failing to unzip works as expected", {
expect_error(wb <- wb_load(tmp_zip), "File does not appear to be xlsx, xlsm or xlsb")

})

test_that("file with [trash] folder works", {

fl <- testfile_path("trash_folder.xlsx")
expect_silent(wb <- wb_load(fl))

})

0 comments on commit 921afc3

Please sign in to comment.