From a8a0f792c8a55795ce9d1d2cfd4fb2e68a8b4924 Mon Sep 17 00:00:00 2001 From: ycphs Date: Wed, 30 Jun 2021 20:58:05 +0200 Subject: [PATCH 1/5] check for illegal characters in sheet names --- R/WorkbookClass.R | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/R/WorkbookClass.R b/R/WorkbookClass.R index 2d5d2ce1..338977c1 100644 --- a/R/WorkbookClass.R +++ b/R/WorkbookClass.R @@ -101,8 +101,8 @@ Workbook$methods( vdpi = openxlsx_getOp("vdpi", 300) ) { if (!missing(sheetName)) { - if (grepl(pattern = ":", x = sheetName)) { - stop("colon not allowed in sheet names in Excel") + if (grepl(pattern = "([/\\*'?\\[:\\]+])",perl = T, x = sheetName)) { + stop("Illegal character in sheet names. Don't use the following [ ] * / \ ? :") } } newSheetIndex <- length(worksheets) + 1L @@ -219,11 +219,7 @@ Workbook$methods( Workbook$methods( cloneWorksheet = function(sheetName, clonedSheet) { clonedSheet <- validateSheet(clonedSheet) - if (!missing(sheetName)) { - if (grepl(pattern = ":", x = sheetName)) { - stop("colon not allowed in sheet names in Excel") - } - } + newSheetIndex <- length(worksheets) + 1L if (newSheetIndex > 1) { sheetId <- @@ -1116,12 +1112,18 @@ Workbook$methods( Workbook$methods( validateSheet = function(sheetName) { + if (!missing(sheetName)) { + if (grepl(pattern = "([/\\*'?\\[:\\]+])",perl = T, x = sheetName)) { + stop("Illegal character in sheet names. Don't use the following [ ] * / \ ? :") + } + } + if (!is.numeric(sheetName)) { if (is.null(sheet_names)) { stop("Workbook does not contain any worksheets.", call. = FALSE) } } - + if (is.numeric(sheetName)) { if (sheetName > length(sheet_names)) { stop("This Workbook only has ", length(sheet_names), @@ -1918,12 +1920,15 @@ Workbook$methods( if (newSheetName %in% sheet_names) { stop(sprintf("Sheet %s already exists!", newSheetName)) } - + + if (grepl(pattern = "([/\\*'?\\[:\\]+])",perl = T, x = newSheetName)) { + stop("Illegal character in sheet names. Don't use the following [ ] * / \ ? :") + } + sheet <- validateSheet(sheet) oldName <- sheet_names[[sheet]] sheet_names[[sheet]] <<- newSheetName - ## Rename in workbook sheetId <- regmatches( From 41898daccba96149b4c07cd521675cb5a632e213 Mon Sep 17 00:00:00 2001 From: ycphs Date: Wed, 30 Jun 2021 21:15:39 +0200 Subject: [PATCH 2/5] add tests for illegal character --- tests/testthat/test-Worksheet_naming.R | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/testthat/test-Worksheet_naming.R b/tests/testthat/test-Worksheet_naming.R index 41eeee35..9879d07d 100644 --- a/tests/testthat/test-Worksheet_naming.R +++ b/tests/testthat/test-Worksheet_naming.R @@ -43,4 +43,18 @@ test_that("Worksheet names", { expect_equal(sheetname,names(wb)) expect_equal("test "A"",wb$sheet_names) + + ### test for illegal characters + + wb <- createWorkbook() + + addWorksheet(wb, "Test") + for(i in c("[", "]", "*", "/", "?", ":")){ + sheetname <- paste0('test_',i) + expect_error(addWorksheet(wb, sheetname)) + expect_error(cloneWorksheet(wb, "Test", sheetname)) + expect_error(renameWorksheet(wb, "Test", sheetname)) + expect_error(parse(names(wb)<- sheetname)) + } + }) From 408d1bcf2713ecf21b9cca92afe5ec5451e65c51 Mon Sep 17 00:00:00 2001 From: ycphs Date: Wed, 30 Jun 2021 21:27:44 +0200 Subject: [PATCH 3/5] add tests for `buildWorkbook` --- tests/testthat/test-Worksheet_naming.R | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/tests/testthat/test-Worksheet_naming.R b/tests/testthat/test-Worksheet_naming.R index 9879d07d..a6908f1a 100644 --- a/tests/testthat/test-Worksheet_naming.R +++ b/tests/testthat/test-Worksheet_naming.R @@ -43,18 +43,30 @@ test_that("Worksheet names", { expect_equal(sheetname,names(wb)) expect_equal("test "A"",wb$sheet_names) - - ### test for illegal characters +}) + + +test_that("test for illegal characters", { + ### wb <- createWorkbook() + x <- data.frame(a = 1, b = 2) addWorksheet(wb, "Test") for(i in c("[", "]", "*", "/", "?", ":")){ sheetname <- paste0('test_',i) + y <- list(a = x, sheetname = x, c = x) expect_error(addWorksheet(wb, sheetname)) expect_error(cloneWorksheet(wb, "Test", sheetname)) expect_error(renameWorksheet(wb, "Test", sheetname)) expect_error(parse(names(wb)<- sheetname)) + expect_error(parse(buildWorkbook(y, asTable = TRUE))) } }) + + + + + + From 2d99b5bad7561a3e6046192f798a741203f564ba Mon Sep 17 00:00:00 2001 From: ycphs Date: Thu, 1 Jul 2021 00:26:07 +0200 Subject: [PATCH 4/5] changes inspired by @jonas-hag --- R/WorkbookClass.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/WorkbookClass.R b/R/WorkbookClass.R index 338977c1..851cc189 100644 --- a/R/WorkbookClass.R +++ b/R/WorkbookClass.R @@ -101,8 +101,8 @@ Workbook$methods( vdpi = openxlsx_getOp("vdpi", 300) ) { if (!missing(sheetName)) { - if (grepl(pattern = "([/\\*'?\\[:\\]+])",perl = T, x = sheetName)) { - stop("Illegal character in sheet names. Don't use the following [ ] * / \ ? :") + if (grepl(pattern = "([/\\\\\\*'?\\[:\\]+])", perl = TRUE, x = sheetName) || nchar(sheetName) == 0) { + stop("Illegal character in sheet names. Don't use the following [ ] * / \\\ ? :") } } newSheetIndex <- length(worksheets) + 1L From 1df98b0d7b9c947f177358a673c471cdae228fd9 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Thu, 1 Jul 2021 02:16:38 +0000 Subject: [PATCH 5/5] revdepcheck run - No changes to commit --- revdep/README.md | 10 +- revdep/failures.md | 238 ++++++++++++++++++++++++++++++++------------- 2 files changed, 177 insertions(+), 71 deletions(-) diff --git a/revdep/README.md b/revdep/README.md index 3bca6c37..f2b2d39f 100644 --- a/revdep/README.md +++ b/revdep/README.md @@ -10,7 +10,7 @@ |collate |C.UTF-8 | |ctype |C.UTF-8 | |tz |UTC | -|date |2021-06-30 | +|date |2021-07-01 | # Dependencies @@ -23,12 +23,13 @@ # Revdeps -## Failed to check (24) +## Failed to check (28) |package |version |error |warning |note | |:--------------|:-------|:-----|:-------|:----| |appreci8R |? | | | | |artMS |? | | | | +|cbaf |? | | | | |CHRONOS |? | | | | |CNVPanelizer |? | | | | |DAPAR |? | | | | @@ -42,10 +43,13 @@ |MatrixQCvis |? | | | | |MicroSEC |? | | | | |nanotatoR |? | | | | +|openPrimeR |? | | | | |PloGO2 |? | | | | |rbiom |? | | | | -|sangeranalyseR |1.2.0 |1 |1 |2 | +|RIPAT |? | | | | +|sangeranalyseR |? | | | | |SEtools |? | | | | +|sigFeature |? | | | | |stplanr |? | | | | |structToolbox |? | | | | |TPP |3.20.0 |1 | |3 | diff --git a/revdep/failures.md b/revdep/failures.md index ea802fcf..1a8af180 100644 --- a/revdep/failures.md +++ b/revdep/failures.md @@ -17,6 +17,67 @@ +Error in download.file(url, destfile, method, mode = "wb", ...) : + download from 'https://bioconductor.org/packages/3.13/data/annotation/src/contrib/MafDb.1Kgenomes.phase3.hs37d5_3.10.0.tar.gz' failed +In addition: Warning messages: +1: In download.file(url, destfile, method, mode = "wb", ...) : + downloaded length 1562737805 != reported length 1623464748 +2: In download.file(url, destfile, method, mode = "wb", ...) : + downloaded length 1562737805 != reported length 1623464748 +3: In download.file(url, destfile, method, mode = "wb", ...) : + URL 'https://bioconductor.org/packages/3.13/data/annotation/src/contrib/MafDb.1Kgenomes.phase3.hs37d5_3.10.0.tar.gz': Timeout of 60 seconds was reached +4: In download.file(url, destfile, method, mode = "wb", ...) : + URL 'https://bioconductor.org/packages/3.13/data/annotation/src/contrib/MafDb.1Kgenomes.phase3.hs37d5_3.10.0.tar.gz': Timeout of 60 seconds was reached +Warning in download.packages(pkgs, destdir = tmpd, available = available, : + download of package ‘MafDb.1Kgenomes.phase3.hs37d5’ failed +Warning in download.packages(pkgs, destdir = tmpd, available = available, : + download of package ‘MafDb.1Kgenomes.phase3.hs37d5’ failed + + +``` +### CRAN + +``` + + + +Error in download.file(url, destfile, method, mode = "wb", ...) : + download from 'https://bioconductor.org/packages/3.13/data/annotation/src/contrib/MafDb.1Kgenomes.phase3.hs37d5_3.10.0.tar.gz' failed +In addition: Warning messages: +1: In download.file(url, destfile, method, mode = "wb", ...) : + downloaded length 1562737805 != reported length 1623464748 +2: In download.file(url, destfile, method, mode = "wb", ...) : + downloaded length 1562737805 != reported length 1623464748 +3: In download.file(url, destfile, method, mode = "wb", ...) : + URL 'https://bioconductor.org/packages/3.13/data/annotation/src/contrib/MafDb.1Kgenomes.phase3.hs37d5_3.10.0.tar.gz': Timeout of 60 seconds was reached +4: In download.file(url, destfile, method, mode = "wb", ...) : + URL 'https://bioconductor.org/packages/3.13/data/annotation/src/contrib/MafDb.1Kgenomes.phase3.hs37d5_3.10.0.tar.gz': Timeout of 60 seconds was reached +Warning in download.packages(pkgs, destdir = tmpd, available = available, : + download of package ‘MafDb.1Kgenomes.phase3.hs37d5’ failed +Warning in download.packages(pkgs, destdir = tmpd, available = available, : + download of package ‘MafDb.1Kgenomes.phase3.hs37d5’ failed + + +``` +# artMS + +
+ +* Version: +* GitHub: https://github.com/ycphs/openxlsx +* Source code: NA +* Number of recursive dependencies: 0 + +
+ +## Error before installation + +### Devel + +``` + + + @@ -31,7 +92,7 @@ ``` -# artMS +# cbaf
@@ -519,6 +580,39 @@ ERROR: lazy loading failed for package ‘hypeR’ +``` +# openPrimeR + +
+ +* Version: +* GitHub: https://github.com/ycphs/openxlsx +* Source code: NA +* Number of recursive dependencies: 0 + +
+ +## Error before installation + +### Devel + +``` + + + + + + +``` +### CRAN + +``` + + + + + + ``` # PloGO2 @@ -586,94 +680,69 @@ ERROR: lazy loading failed for package ‘hypeR’ ``` -# sangeranalyseR +# RIPAT
-* Version: 1.2.0 -* GitHub: NA -* Source code: https://github.com/cran/sangeranalyseR -* Date/Publication: 2021-05-19 -* Number of recursive dependencies: 142 - -Run `revdep_details(, "sangeranalyseR")` for more info +* Version: +* GitHub: https://github.com/ycphs/openxlsx +* Source code: NA +* Number of recursive dependencies: 0
-## In both +## Error before installation -* checking whether package ‘sangeranalyseR’ can be installed ... ERROR - ``` - Installation failed. - See ‘/home/runner/work/openxlsx/openxlsx/revdep/checks/sangeranalyseR/new/sangeranalyseR.Rcheck/00install.out’ for details. - ``` +### Devel -* checking for portable file names ... WARNING - ``` - Found the following file with a non-portable file name: - docs/wallpaperflare.com_wallpaper (1).jpg - These are not fully portable file names. - See section ‘Package structure’ in the ‘Writing R Extensions’ manual. - ``` +``` -* checking package dependencies ... NOTE - ``` - Depends: includes the non-default packages: - 'stringr', 'ape', 'Biostrings', 'DECIPHER', 'parallel', 'reshape2', - 'phangorn', 'sangerseqR', 'gridExtra', 'shiny', 'shinydashboard', - 'shinyjs', 'data.table', 'plotly', 'DT', 'zeallot', 'excelR', - 'shinycssloaders', 'ggdendro', 'shinyWidgets', 'openxlsx', 'tools', - 'rmarkdown', 'kableExtra', 'seqinr', 'BiocStyle', 'logger' - Adding so many packages to the search path is excessive and importing - selectively is preferable. - ``` -* checking for hidden files and directories ... NOTE - ``` - Found the following hidden files and directories: - .travis.yml - docs/build/html/.buildinfo - These were most likely included in error. See section ‘Package - structure’ in the ‘Writing R Extensions’ manual. - ``` -## Installation + + + +``` +### CRAN + +``` + + + + + + +``` +# sangeranalyseR + +
+ +* Version: +* GitHub: https://github.com/ycphs/openxlsx +* Source code: NA +* Number of recursive dependencies: 0 + +
+ +## Error before installation ### Devel ``` -* installing *source* package ‘sangeranalyseR’ ... -** using staged installation -** R -** data -** inst -** byte-compile and prepare package for lazy loading -Error: package or namespace load failed for ‘phangorn’ in dyn.load(file, DLLpath = DLLpath, ...): - unable to load shared object '/home/runner/work/openxlsx/openxlsx/revdep/library/sangeranalyseR/igraph/libs/igraph.so': - libglpk.so.40: cannot open shared object file: No such file or directory -Error: package ‘phangorn’ could not be loaded -Execution halted -ERROR: lazy loading failed for package ‘sangeranalyseR’ -* removing ‘/home/runner/work/openxlsx/openxlsx/revdep/checks/sangeranalyseR/new/sangeranalyseR.Rcheck/sangeranalyseR’ + + + + ``` ### CRAN ``` -* installing *source* package ‘sangeranalyseR’ ... -** using staged installation -** R -** data -** inst -** byte-compile and prepare package for lazy loading -Error: package or namespace load failed for ‘phangorn’ in dyn.load(file, DLLpath = DLLpath, ...): - unable to load shared object '/home/runner/work/openxlsx/openxlsx/revdep/library/sangeranalyseR/igraph/libs/igraph.so': - libglpk.so.40: cannot open shared object file: No such file or directory -Error: package ‘phangorn’ could not be loaded -Execution halted -ERROR: lazy loading failed for package ‘sangeranalyseR’ -* removing ‘/home/runner/work/openxlsx/openxlsx/revdep/checks/sangeranalyseR/old/sangeranalyseR.Rcheck/sangeranalyseR’ + + + + ``` @@ -709,6 +778,39 @@ ERROR: lazy loading failed for package ‘sangeranalyseR’ +``` +# sigFeature + +
+ +* Version: +* GitHub: https://github.com/ycphs/openxlsx +* Source code: NA +* Number of recursive dependencies: 0 + +
+ +## Error before installation + +### Devel + +``` + + + + + + +``` +### CRAN + +``` + + + + + + ``` # stplanr