diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0204e9a6..d2df3894 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -82,7 +82,7 @@ jobs: if: ${ (env.ACT || false)} run: sudo apt update - name: Install Tidy Ubuntu - run: sudo apt install -y tidy + run: apt update && sudo apt install -y tidy - name: build tarball for submission to CRAN run: R CMD build $GITHUB_WORKSPACE - name: Grab tarball path diff --git a/NEWS.md b/NEWS.md index 80ff5794..7cb790b1 100644 --- a/NEWS.md +++ b/NEWS.md @@ -5,8 +5,11 @@ ## CHANGES * Updated `pkgnet-intro` vignette to include information on the Class Inheritance Reporter and other minor edits. +* Recursive function network creation made tolerant to empty lists. (#322) +* Excessive warnings removed for custom `vignette_path` param in `CreatePackageVignette()` (#322) ## BUGFIXES +* `CreatePackageReporter()` failing on Windows to build package coverage when `report_path` specified. (#322) # pkgnet 0.4.2 ## NEW FEATURES diff --git a/R/CreatePackageVignette.R b/R/CreatePackageVignette.R index 8f423d6b..07c7edb8 100644 --- a/R/CreatePackageVignette.R +++ b/R/CreatePackageVignette.R @@ -85,42 +85,6 @@ CreatePackageVignette <- function(pkg = "." , dirname(vignette_path))) } - # Check if vignette_path matches the right package - # if the path is to a file in a directory named vignettes - vignetteDirAbsPath <- normalizePath(dirname(vignette_path)) - # If path is a vignettes directory - if (grepl('/vignettes$', vignetteDirAbsPath)) { - # Get path for expected DESCRIPTION file for package - expectedDescriptionPath <- gsub( - pattern = "vignettes$" - , replacement = "DESCRIPTION" - , x = vignetteDirAbsPath - ) - - # If DESCRIPTION file exists check the name - if (file.exists(expectedDescriptionPath)) { - foundPkgName <- read.dcf(expectedDescriptionPath)[1,][["Package"]] - - # If it doesn't match pkg_name, give warning - if (!identical(foundPkgName, pkg_name)) { - log_warn(glue::glue( - "You are writing a report for {pkg_name} to the vignettes " - , "directory for {foundPkgName}" - , pkg_name = pkg_name - , foundPkgName = foundPkgName)) - } - - # Otherwise, warn that we're writing to a vignettes folder inside - # a directory that is not a package root - } else { - log_warn(paste( - "You specified a path to a vignettes directory" - , vignetteDirAbsPath - , "that is not inside a package root directory." - )) - } - } - log_info(sprintf( "Creating pkgnet package report as vignette for %s..." , pkg_name diff --git a/R/FunctionReporter.R b/R/FunctionReporter.R index d8ca0c3e..ff404dfc 100644 --- a/R/FunctionReporter.R +++ b/R/FunctionReporter.R @@ -151,12 +151,24 @@ FunctionReporter <- R6::R6Class( log_info(sprintf("Calculating test coverage for %s...", self$pkg_name)) + # workaround for covr conflict with loaded packages on windows + if(.Platform$OS.type == "windows") { + detach(paste0('package:',self$pkg_name), unload = TRUE, character.only = TRUE) + } + pkgCovDT <- data.table::as.data.table(covr::package_coverage( path = private$pkg_path , type = "tests" , combine_types = FALSE + , quiet = FALSE + , clean = FALSE )) + # workaround for covr conflict with loaded packages on windows + if(.Platform$OS.type == "windows") { + attachNamespace(self$pkg_name) + } + pkgCovDT <- pkgCovDT[, .(coveredLines = sum(value > 0) , totalLines = .N , coverageRatio = sum(value > 0)/.N @@ -395,12 +407,17 @@ FunctionReporter <- R6::R6Class( if (!is.list(x) && listable) { x <- as.list(x) - # Check for expression of the form foo$bar - # We still want to split it up because foo might be a function - # but we want to get rid of bar, because it's a symbol in foo's namespace - # and not a symbol that could be reliably matched to the package namespace - if (identical(x[[1]], quote(`$`))) { - x <- x[1:2] + if (length(x) > 0){ + # Check for expression of the form foo$bar + # We still want to split it up because foo might be a function + # but we want to get rid of bar, because it's a symbol in foo's namespace + # and not a symbol that could be reliably matched to the package namespace + if (identical(x[[1]], quote(`$`))) { + x <- x[1:2] + } + } else { + # make empty lists "not listable" so recursion stops + listable <- FALSE } } @@ -643,9 +660,10 @@ FunctionReporter <- R6::R6Class( if (!is.list(x) && listable) { xList <- as.list(x) + if (length(xList) > 0){ + # Check if expression x is from _$_ if (identical(xList[[1]], quote(`$`))) { - # Check if expression x is of form self$foo, private$foo, or super$foo # We want to keep those together because they could refer to the class' # methods. So expression is not listable @@ -654,6 +672,7 @@ FunctionReporter <- R6::R6Class( || identical(xList[[2]], quote(super))) { listable <- FALSE + # If expression lefthand side is not keyword, we still want to split # it up because left might be a function # but we want to get rid of right, because it's a symbol in left's namespace @@ -667,8 +686,15 @@ FunctionReporter <- R6::R6Class( } else { x <- xList } + } else { + # make empty list "non-listable" so recursion stops + listable <- FALSE + } + } + + if (listable){ # Filter out atomic values because we don't care about them x <- Filter(f = Negate(is.atomic), x = x) diff --git a/inst/baseballstats/DESCRIPTION b/inst/baseballstats/DESCRIPTION index 8747b126..57638582 100644 --- a/inst/baseballstats/DESCRIPTION +++ b/inst/baseballstats/DESCRIPTION @@ -18,4 +18,3 @@ Suggests: License: file LICENSE LazyData: TRUE RoxygenNote: 7.1.0 -Roxygen: list(r6 = FALSE) diff --git a/inst/milne/DESCRIPTION b/inst/milne/DESCRIPTION index 861faa4a..a07958b4 100644 --- a/inst/milne/DESCRIPTION +++ b/inst/milne/DESCRIPTION @@ -17,5 +17,4 @@ LinkingTo: Rcpp License: file LICENSE LazyData: TRUE -RoxygenNote: 7.1.0 -Roxygen: list(r6 = FALSE) +RoxygenNote: 7.3.1 diff --git a/inst/milne/R/The_End.R b/inst/milne/R/The_End.R index d18c4fd5..5a189261 100644 --- a/inst/milne/R/The_End.R +++ b/inst/milne/R/The_End.R @@ -1,22 +1,36 @@ # R6 Class Definitions for testing -#' @title Age One -#' @name One -#' @family TheEnd -#' @description Age One +#' R6 Class Age One +#' +#' @description +#' Age One +#' +#' @details +#' Age One +#' #' @importFrom R6 R6Class #' @export One <- R6::R6Class( classname = "One", public = list( + + #' @description + #' Create a New Age One Object + #' @return An Age One Object initialize = function() { cat("The End, by A. A. Milne \n") }, + + #' @description + #' Print poem print_poem = function() { cat("When I was One, \n", "I had just begun. \n" ) }, + + #' @description + #' Get Age how_old_am_i = function() {private$get_age()} ), private = list( @@ -24,16 +38,22 @@ One <- R6::R6Class( ) ) -#' @title Age Two -#' @name Two -#' @family TheEnd -#' @description Age Two +#' R6 Class Age Two +#' +#' @description +#' Age Two +#' +#' @details +#' Age Two +#' #' @importFrom R6 R6Class #' @export Two <- R6::R6Class( classname = "Two", inherit = One, public = list( + #' @description + #' Print poem two print_poem = function() { super$print_poem() cat("When I was Two, \n", @@ -43,10 +63,14 @@ Two <- R6::R6Class( ) ) -#' @title Age Three -#' @name Three -#' @family TheEnd -#' @description Age Three +#' R6 Class Age Three +#' +#' @description +#' Age Three +#' +#' @details +#' Age Three +#' #' @importFrom R6 R6Class #' @export Three <- R6::R6Class( @@ -54,6 +78,8 @@ Three <- R6::R6Class( classname = "HardlyThree", inherit = Two, public = list( + #' @description + #' Print poem thrice print_poem = function() { super$print_poem() cat("When I was Three, \n", @@ -63,10 +89,14 @@ Three <- R6::R6Class( ) ) -#' @title Age Four -#' @name Four -#' @family TheEnd -#' @description Age Four +#' R6 Class Age Four +#' +#' @description +#' Age Four +#' +#' @details +#' Age Four +#' #' @importFrom R6 R6Class #' @export Four <- R6::R6Class( @@ -74,6 +104,8 @@ Four <- R6::R6Class( classname = NULL, inherit = Three, public = list( + #' @description + #' Print poem four print_poem = function() { super$print_poem() cat("When I was Four, \n", @@ -83,16 +115,24 @@ Four <- R6::R6Class( ) ) -#' @title Age Five -#' @name Five -#' @family TheEnd -#' @description Age Five +#' R6 Class Age Five +#' +#' @description +#' Age Five +#' +#' @details +#' Age Five +#' #' @importFrom R6 R6Class #' @export Five <- R6::R6Class( classname = "Five", inherit = Four, public = list( + #' @description + #' Print poem five times + #' @details + #' Did your hand hit on the river? print_poem = function() { super$print_poem() cat("When I was Five, \n", @@ -104,16 +144,24 @@ Five <- R6::R6Class( ) ) -#' @title Age Six -#' @name Six -#' @family TheEnd -#' @description Age Six +#' R6 Class Age Six +#' +#' @description +#' Age Six +#' +#' @details +#' Age Six +#' #' @importFrom R6 R6Class #' @export Six <- R6::R6Class( classname = "Six", inherit = Five, public = list( + #' @description + #' Print poem six times + #' @details + #' I should have looked ahead print_poem = function() { super$print_poem() cat("But now I am Six,", @@ -123,6 +171,7 @@ Six <- R6::R6Class( } ), private = list( + # I don't think private classes and methods are supported by Roxygen2 print_ending = function() { cat("So I think I'll be six now", "for ever and ever." diff --git a/inst/milne/man/Five.Rd b/inst/milne/man/Five.Rd index c39c415a..50e71d4d 100644 --- a/inst/milne/man/Five.Rd +++ b/inst/milne/man/Five.Rd @@ -1,19 +1,61 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/The_End.R -\docType{data} \name{Five} \alias{Five} -\title{Age Five} -\format{An object of class \code{R6ClassGenerator} of length 24.} -\usage{ -Five -} +\title{R6 Class Age Five} \description{ Age Five } -\seealso{ -Other TheEnd: \code{\link{Four}}, \code{\link{One}}, - \code{\link{Six}}, \code{\link{Three}}, \code{\link{Two}} +\details{ +Age Five +} +\section{Super classes}{ +\code{milne::One} -> \code{milne::Two} -> \code{milne::HardlyThree} -> \code{milne::NA} -> \code{Five} +} +\section{Methods}{ +\subsection{Public methods}{ +\itemize{ +\item \href{#method-Five-print_poem}{\code{Five$print_poem()}} +\item \href{#method-Five-clone}{\code{Five$clone()}} +} +} +\if{html}{\out{ +
Inherited methods + +
+}} +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-Five-print_poem}{}}} +\subsection{Method \code{print_poem()}}{ +Print poem five times +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{Five$print_poem()}\if{html}{\out{
}} +} + +\subsection{Details}{ +Did your hand hit on the river? +} + +} +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-Five-clone}{}}} +\subsection{Method \code{clone()}}{ +The objects of this class are cloneable with this method. +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{Five$clone(deep = FALSE)}\if{html}{\out{
}} +} + +\subsection{Arguments}{ +\if{html}{\out{
}} +\describe{ +\item{\code{deep}}{Whether to make a deep clone.} +} +\if{html}{\out{
}} +} +} } -\concept{TheEnd} -\keyword{datasets} diff --git a/inst/milne/man/Four.Rd b/inst/milne/man/Four.Rd index d41179bc..0960b82e 100644 --- a/inst/milne/man/Four.Rd +++ b/inst/milne/man/Four.Rd @@ -1,19 +1,57 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/The_End.R -\docType{data} \name{Four} \alias{Four} -\title{Age Four} -\format{An object of class \code{R6ClassGenerator} of length 24.} -\usage{ -Four -} +\title{R6 Class Age Four} \description{ Age Four } -\seealso{ -Other TheEnd: \code{\link{Five}}, \code{\link{One}}, - \code{\link{Six}}, \code{\link{Three}}, \code{\link{Two}} +\details{ +Age Four +} +\section{Super classes}{ +\code{milne::One} -> \code{milne::Two} -> \code{milne::HardlyThree} +} +\section{Methods}{ +\subsection{Public methods}{ +\itemize{ +\item \href{#method-NA-print_poem}{\code{Four$print_poem()}} +\item \href{#method-unknown-clone}{\code{Four$clone()}} +} +} +\if{html}{\out{ +
Inherited methods + +
+}} +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-NA-print_poem}{}}} +\subsection{Method \code{print_poem()}}{ +Print poem four +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{Four$print_poem()}\if{html}{\out{
}} +} + +} +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-unknown-clone}{}}} +\subsection{Method \code{clone()}}{ +The objects of this class are cloneable with this method. +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{Four$clone(deep = FALSE)}\if{html}{\out{
}} +} + +\subsection{Arguments}{ +\if{html}{\out{
}} +\describe{ +\item{\code{deep}}{Whether to make a deep clone.} +} +\if{html}{\out{
}} +} +} } -\concept{TheEnd} -\keyword{datasets} diff --git a/inst/milne/man/One.Rd b/inst/milne/man/One.Rd index 8d227d54..92518292 100644 --- a/inst/milne/man/One.Rd +++ b/inst/milne/man/One.Rd @@ -1,19 +1,71 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/The_End.R -\docType{data} \name{One} \alias{One} -\title{Age One} -\format{An object of class \code{R6ClassGenerator} of length 24.} -\usage{ -One -} +\title{R6 Class Age One} \description{ Age One } -\seealso{ -Other TheEnd: \code{\link{Five}}, \code{\link{Four}}, - \code{\link{Six}}, \code{\link{Three}}, \code{\link{Two}} +\details{ +Age One +} +\section{Methods}{ +\subsection{Public methods}{ +\itemize{ +\item \href{#method-One-new}{\code{One$new()}} +\item \href{#method-One-print_poem}{\code{One$print_poem()}} +\item \href{#method-One-how_old_am_i}{\code{One$how_old_am_i()}} +\item \href{#method-One-clone}{\code{One$clone()}} +} +} +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-One-new}{}}} +\subsection{Method \code{new()}}{ +Create a New Age One Object +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{One$new()}\if{html}{\out{
}} +} + +\subsection{Returns}{ +An Age One Object +} +} +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-One-print_poem}{}}} +\subsection{Method \code{print_poem()}}{ +Print poem +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{One$print_poem()}\if{html}{\out{
}} +} + +} +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-One-how_old_am_i}{}}} +\subsection{Method \code{how_old_am_i()}}{ +Get Age +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{One$how_old_am_i()}\if{html}{\out{
}} +} + +} +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-One-clone}{}}} +\subsection{Method \code{clone()}}{ +The objects of this class are cloneable with this method. +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{One$clone(deep = FALSE)}\if{html}{\out{
}} +} + +\subsection{Arguments}{ +\if{html}{\out{
}} +\describe{ +\item{\code{deep}}{Whether to make a deep clone.} +} +\if{html}{\out{
}} +} +} } -\concept{TheEnd} -\keyword{datasets} diff --git a/inst/milne/man/PoohAnswer.Rd b/inst/milne/man/PoohAnswer.Rd index 2c59ea3b..c433f244 100644 --- a/inst/milne/man/PoohAnswer.Rd +++ b/inst/milne/man/PoohAnswer.Rd @@ -10,6 +10,7 @@ Pooh's Answer to a Question } \seealso{ -Other TheFriend: \code{\link{RightAnswer}} +Other TheFriend: +\code{\link{RightAnswer}} } \concept{TheFriend} diff --git a/inst/milne/man/RightAnswer.Rd b/inst/milne/man/RightAnswer.Rd index c7f4b74a..c6471747 100644 --- a/inst/milne/man/RightAnswer.Rd +++ b/inst/milne/man/RightAnswer.Rd @@ -9,6 +9,7 @@ Correct Answer to a Question } \seealso{ -Other TheFriend: \code{\link{PoohAnswer}} +Other TheFriend: +\code{\link{PoohAnswer}} } \concept{TheFriend} diff --git a/inst/milne/man/Six.Rd b/inst/milne/man/Six.Rd index 5baae338..664c8518 100644 --- a/inst/milne/man/Six.Rd +++ b/inst/milne/man/Six.Rd @@ -1,19 +1,61 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/The_End.R -\docType{data} \name{Six} \alias{Six} -\title{Age Six} -\format{An object of class \code{R6ClassGenerator} of length 24.} -\usage{ -Six -} +\title{R6 Class Age Six} \description{ Age Six } -\seealso{ -Other TheEnd: \code{\link{Five}}, \code{\link{Four}}, - \code{\link{One}}, \code{\link{Three}}, \code{\link{Two}} +\details{ +Age Six +} +\section{Super classes}{ +\code{milne::One} -> \code{milne::Two} -> \code{milne::HardlyThree} -> \code{milne::NA} -> \code{milne::Five} -> \code{Six} +} +\section{Methods}{ +\subsection{Public methods}{ +\itemize{ +\item \href{#method-Six-print_poem}{\code{Six$print_poem()}} +\item \href{#method-Six-clone}{\code{Six$clone()}} +} +} +\if{html}{\out{ +
Inherited methods + +
+}} +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-Six-print_poem}{}}} +\subsection{Method \code{print_poem()}}{ +Print poem six times +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{Six$print_poem()}\if{html}{\out{
}} +} + +\subsection{Details}{ +I should have looked ahead +} + +} +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-Six-clone}{}}} +\subsection{Method \code{clone()}}{ +The objects of this class are cloneable with this method. +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{Six$clone(deep = FALSE)}\if{html}{\out{
}} +} + +\subsection{Arguments}{ +\if{html}{\out{
}} +\describe{ +\item{\code{deep}}{Whether to make a deep clone.} +} +\if{html}{\out{
}} +} +} } -\concept{TheEnd} -\keyword{datasets} diff --git a/inst/milne/man/Three.Rd b/inst/milne/man/Three.Rd index c6a5d574..08862ffc 100644 --- a/inst/milne/man/Three.Rd +++ b/inst/milne/man/Three.Rd @@ -1,19 +1,57 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/The_End.R -\docType{data} \name{Three} \alias{Three} -\title{Age Three} -\format{An object of class \code{R6ClassGenerator} of length 24.} -\usage{ -Three -} +\title{R6 Class Age Three} \description{ Age Three } -\seealso{ -Other TheEnd: \code{\link{Five}}, \code{\link{Four}}, - \code{\link{One}}, \code{\link{Six}}, \code{\link{Two}} +\details{ +Age Three +} +\section{Super classes}{ +\code{milne::One} -> \code{milne::Two} -> \code{HardlyThree} +} +\section{Methods}{ +\subsection{Public methods}{ +\itemize{ +\item \href{#method-HardlyThree-print_poem}{\code{Three$print_poem()}} +\item \href{#method-HardlyThree-clone}{\code{Three$clone()}} +} +} +\if{html}{\out{ +
Inherited methods + +
+}} +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-HardlyThree-print_poem}{}}} +\subsection{Method \code{print_poem()}}{ +Print poem thrice +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{Three$print_poem()}\if{html}{\out{
}} +} + +} +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-HardlyThree-clone}{}}} +\subsection{Method \code{clone()}}{ +The objects of this class are cloneable with this method. +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{Three$clone(deep = FALSE)}\if{html}{\out{
}} +} + +\subsection{Arguments}{ +\if{html}{\out{
}} +\describe{ +\item{\code{deep}}{Whether to make a deep clone.} +} +\if{html}{\out{
}} +} +} } -\concept{TheEnd} -\keyword{datasets} diff --git a/inst/milne/man/Two.Rd b/inst/milne/man/Two.Rd index 65cafb21..f6200d25 100644 --- a/inst/milne/man/Two.Rd +++ b/inst/milne/man/Two.Rd @@ -1,19 +1,57 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/The_End.R -\docType{data} \name{Two} \alias{Two} -\title{Age Two} -\format{An object of class \code{R6ClassGenerator} of length 24.} -\usage{ -Two -} +\title{R6 Class Age Two} \description{ Age Two } -\seealso{ -Other TheEnd: \code{\link{Five}}, \code{\link{Four}}, - \code{\link{One}}, \code{\link{Six}}, \code{\link{Three}} +\details{ +Age Two +} +\section{Super class}{ +\code{milne::One} -> \code{Two} +} +\section{Methods}{ +\subsection{Public methods}{ +\itemize{ +\item \href{#method-Two-print_poem}{\code{Two$print_poem()}} +\item \href{#method-Two-clone}{\code{Two$clone()}} +} +} +\if{html}{\out{ +
Inherited methods + +
+}} +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-Two-print_poem}{}}} +\subsection{Method \code{print_poem()}}{ +Print poem two +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{Two$print_poem()}\if{html}{\out{
}} +} + +} +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-Two-clone}{}}} +\subsection{Method \code{clone()}}{ +The objects of this class are cloneable with this method. +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{Two$clone(deep = FALSE)}\if{html}{\out{
}} +} + +\subsection{Arguments}{ +\if{html}{\out{
}} +\describe{ +\item{\code{deep}}{Whether to make a deep clone.} +} +\if{html}{\out{
}} +} +} } -\concept{TheEnd} -\keyword{datasets} diff --git a/inst/sartre/DESCRIPTION b/inst/sartre/DESCRIPTION index 5ad411a5..6234b02c 100644 --- a/inst/sartre/DESCRIPTION +++ b/inst/sartre/DESCRIPTION @@ -12,4 +12,3 @@ Description: This package is used to test the functions in `pkgnet`. It's a "no License: file LICENSE LazyData: TRUE RoxygenNote: 7.1.0 -Roxygen: list(r6 = FALSE) diff --git a/inst/silverstein/DESCRIPTION b/inst/silverstein/DESCRIPTION index 856d886c..1a3bb058 100644 --- a/inst/silverstein/DESCRIPTION +++ b/inst/silverstein/DESCRIPTION @@ -12,4 +12,3 @@ LazyData: TRUE RoxygenNote: 7.1.0 Suggests: testthat (>= 2.1.0) -Roxygen: list(r6 = FALSE) diff --git a/tests/testthat/test-CreatePackageVignette.R b/tests/testthat/test-CreatePackageVignette.R index 9cea5245..44d88762 100644 --- a/tests/testthat/test-CreatePackageVignette.R +++ b/tests/testthat/test-CreatePackageVignette.R @@ -174,51 +174,3 @@ test_that("Test that CreatePackageVignette errors for bad inputs", { , fixed = TRUE ) }) - -test_that("CreatePackageVignette warns if vignette_path seems wrong", { - - pkgPath <- .CreateSourceCopy(sourcePath) - on.exit(expr = unlink(pkgPath, recursive = TRUE)) - - # In a vignettes directory that isn't in a package root - vignettesDir <- file.path(tempdir(), "vignettes") - dir.create(vignettesDir) - expect_warning( - CreatePackageVignette(pkg = pkgPath - , vignette_path = file.path(vignettesDir - , "pkgnet_report.Rmd") - ) - , regexp = paste("not inside a package root directory") - , fixed = TRUE - ) - # Clean up - unlink(file.path(tempdir(), "vignettes"), recursive = TRUE) - - # If in root of a different package - suppressWarnings({ - # creating a temporary environment to avoid the following error from package.skeleton() - # "... no R objects specified or available" - basketball_env <- new.env() - basketball_env[["a"]] <- function(){return(1)} - utils::package.skeleton( - name = "basketballstats" - , environment = basketball_env - , path = tempdir() - ) - }) - dir.create(file.path(tempdir(), "basketballstats", "vignettes")) - expect_warning( - CreatePackageVignette(pkg = pkgPath - , vignette_path = file.path(tempdir() - , "basketballstats" - , "vignettes" - , "pkgnet_report.Rmd") - ) - , regexp = paste("You are writing a report for baseballstats to the" - , "vignettes directory for basketballstats") - , fixed = TRUE - ) - # Clean up - unlink(file.path(tempdir(), "basketballstats"), recursive = TRUE) - -})