New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

memoise -- loadFromRepo #17

Merged
merged 4 commits into from Mar 27, 2018

Conversation

Projects
None yet
3 participants
@eliotmcintire
Contributor

eliotmcintire commented Mar 26, 2018

No description provided.

@lintr-bot

This comment has been minimized.

lintr-bot commented Mar 26, 2018

inst/examples/example_Cache.R:171:1: style: Trailing blank lines are superfluous.

^

R/cache-helpers.R:940:3: style: Commented code should be removed.

# loadFromLocalRepoMem <- memoise::memoise(loadFromLocalRepo)
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cache-tools.R:85:9: style: Commented code should be removed.

# fn <- unique(objsDT[tagKey == "memoisedFunction", tagValue])
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cache-tools.R:87:11: style: Commented code should be removed.

#   forget(.memoisedCacheFuns[[f]])
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cache.R:151:1: style: Lines should not be more than 100 characters.

#'        object (from e.g., \code{asPath(filename)}) or it is a \code{Raster} with file-backing, then this will be
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cache.R:269:1: style: Lines should not be more than 100 characters.

if (R.version[['minor']] < 3.4) { # match.call changed how it worked between 3.3.2 and 3.4.x MUCH SLOWER
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cache.R:269:20: style: Only use double-quotes.

if (R.version[['minor']] < 3.4) { # match.call changed how it worked between 3.3.2 and 3.4.x MUCH SLOWER
                   ^~~~~~~

R/cache.R:269:37: style: Opening curly braces should never go on their own line and should always be followed by a new line.

if (R.version[['minor']] < 3.4) { # match.call changed how it worked between 3.3.2 and 3.4.x MUCH SLOWER
                                    ^

R/cache.R:285:28: style: Opening curly braces should never go on their own line and should always be followed by a new line.

if (any(!objOverride)) { # put into .reproEnv
                           ^

R/cache.R:307:26: style: Opening curly braces should never go on their own line and should always be followed by a new line.

if (any(!prevVals)){ # don't override previous values -- except for userTags
                         ^

R/cache.R:321:27: style: Opening curly braces should never go on their own line and should always be followed by a new line.

if (any(objOverride)) { # get from .reproEnv
                          ^

R/cache.R:342:13: style: Commented code should be removed.

#       rawFunName <- deparse(substitute(FUN, env = whereInStack("Cache")))
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cache.R:343:13: style: Commented code should be removed.

#       funName <- paste0("Cache_", rawFunName)
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cache.R:345:15: style: Commented code should be removed.

#         .memoisedCacheFuns[[funName]] <- CacheMem
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cache.R:349:17: style: Commented code should be removed.

#           forget(.memoisedCacheFuns[[funName]])
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cache.R:352:13: style: Commented code should be removed.

#       mc <- match.call(expand.dots = TRUE)
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cache.R:353:13: style: Commented code should be removed.

#       mc[[1]] <- as.name(funName)
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cache.R:354:13: style: Commented code should be removed.

#       mc <- as.list(mc)
            ^~~~~~~~~~~~~~~~~

R/cache.R:355:13: style: Commented code should be removed.

#       mc$quick <- NA
            ^~~~~~~~~~~~~~

R/cache.R:356:13: style: Commented code should be removed.

#       mc[[1]] <- NULL
            ^~~~~~~~~~~~~~~

R/cache.R:357:13: style: Commented code should be removed.

#       mc$userTags <- c(paste0("memoisedFunction:",funName), mc$userTags)
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cache.R:358:13: style: Commented code should be removed.

#       out <- do.call(.memoisedCacheFuns[[funName]], mc)#)
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cache.R:361:17: style: Commented code should be removed.

#           md5Hash <- searchInLocalRepo(pattern = attr(out, "tags"), repoDir = cacheRepo)
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cache.R:367:17: style: Commented code should be removed.

#           .cacheMessage("", paste("Memoised",rawFunName))
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cache.R:370:13: style: Commented code should be removed.

#       return(out)
            ^~~~~~~~~~~

R/cache.R:375:9: style: Commented code should be removed.

#   quick <- TRUE
        ^~~~~~~~~~~~~

R/cache.R:534:1: style: Lines should not be more than 100 characters.

elapsedTime = as.numeric(difftime(endHashTime, startHashTime, units = "secs")),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cache.R:549:1: style: Lines should not be more than 100 characters.

preDigestUnlistNames <- unlist(lapply(strsplit(names(preDigestUnlist), split = "\\."), tail, 1))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cache.R:552:1: style: Lines should not be more than 100 characters.

hashDetails$objectSize[preDigestUnlistNames %in% hashObjectSizeNames] <- hashObjectSize[hashObjectSizeNames %in% preDigestUnlistNames]
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cache.R:559:9: style: Opening curly braces should never go on their own line and should always be followed by a new line.

​        {
        ^

R/cache.R:617:1: style: Lines should not be more than 100 characters.

elapsedTime = as.numeric(difftime(endLoadTime, startLoadTime, units = "secs")),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cache.R:717:18: style: Opening curly braces should never go on their own line and should always be followed by a new line.

if (FALSE) { # INCOMPLETE
                 ^

R/cache.R:723:58: style: Commas should always have a space after.

similarObjs <- loadFromLocalRepo(similar[1,artifact],
                                                         ^

R/cache.R:753:1: style: Lines should not be more than 100 characters.

elapsedTime = as.numeric(difftime(endRunTime, startRunTime, units = "secs")),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cache.R:761:1: style: Lines should not be more than 100 characters.

# on.exit({message("Running ", functionDetails$functionName, " took ", format(endRunTime - startRunTime))},
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cache.R:892:1: style: Lines should not be more than 100 characters.

elapsedTime = as.numeric(difftime(endSaveTime, startSaveTime, units = "secs")),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cache.R:937:3: style: Commented code should be removed.

# .memoisedCacheFuns <- new.env(parent = asNamespace("reproducible"))
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cache.R:938:3: style: Commented code should be removed.

# CacheMem <- memoise::memoise(Cache)
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cache.R:940:34: style: Place a space before left parenthesis, except in a function call.

​.formalsCache <- formals(Cache)[-(1:2)]
                                 ^

R/objectSize.R:29:1: style: Variable or function name should be lowerCamelCase.

objectSize.list <- function(x, quick = getOption("reproducible.quick", FALSE)) {
^~~~~~~~~~~~~~~

R/objectSize.R:36:1: style: Variable or function name should be lowerCamelCase.

objectSize.environment <- function(x, quick = getOption("reproducible.quick", FALSE)) {
^~~~~~~~~~~~~~~~~~~~~~

R/objectSize.R:47:1: style: Variable or function name should be lowerCamelCase.

objectSize.default <- function(x, quick = getOption("reproducible.quick", FALSE)) {
^~~~~~~~~~~~~~~~~~

R/objectSize.R:53:1: style: Variable or function name should be lowerCamelCase.

objectSize.Path <- function(x, quick = getOption("reproducible.quick", FALSE)) {
^~~~~~~~~~~~~~~

R/packages.R:121:29: style: Opening curly braces should never go on their own line and should always be followed by a new line.

if (is.name(subpackages)) { # single, non quoted object
                            ^

R/packages.R:123:1: style: Lines should not be more than 100 characters.

if (!exists(subpackages, envir = parent.frame())) # if it does exist, then it is not a name, but an object
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/packages.R:145:31: style: Commented code should be removed.

nonLibPathPkgs <- ips # unlist(lapply(nonLibPathPaths, dir))
                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/packages.R:502:1: style: Lines should not be more than 100 characters.

available.packagesMem <- function(contriburl, method, fields, type, filters, repos) {# This will be replaced upon first calls to
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/packages.R:502:1: style: Variable or function name should be lowerCamelCase.

available.packagesMem <- function(contriburl, method, fields, type, filters, repos) {# This will be replaced upon first calls to
^~~~~~~~~~~~~~~~~~~~~

R/packages.R:502:85: style: Opening curly braces should never go on their own line and should always be followed by a new line.

available.packagesMem <- function(contriburl, method, fields, type, filters, repos) {# This will be replaced upon first calls to
                                                                                    ^

R/packages.R:807:1: style: Lines should not be more than 100 characters.

#' @importFrom utils read.table available.packages installed.packages install.packages assignInMyNamespace
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/pipe.R:198:5: style: Commented code should be removed.

# isFirstElemAnObj <- exists(as.character(lhs[[1]][[1]]))
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/pipe.R:200:7: style: Commented code should be removed.

#   lhs[[1]] <- lhs[[1]][[1]]
      ^~~~~~~~~~~~~~~~~~~~~~~~~

R/pipe.R:217:6: style: Commented code should be removed.

#rhss[[1]] <- rhss[[1]][-2]
     ^~~~~~~~~~~~~~~~~~~~~~~~~~

R/pipe.R:254:3: style: Variable or function name should be lowerCamelCase.

RHS <- as.list(mc)[[1]]
  ^~~

R/RcppExports.R:17:11: style: Only use double-quotes.

​    .Call('_reproducible_readLinesRcppInternal', PACKAGE = 'reproducible', path)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/RcppExports.R:17:60: style: Only use double-quotes.

​    .Call('_reproducible_readLinesRcppInternal', PACKAGE = 'reproducible', path)
                                                           ^~~~~~~~~~~~~~

R/RcppExports.R:19:1: style: Trailing blank lines are superfluous.

^

tests/testthat/helper-allEqual.R:1:1: style: Variable or function name should be lowerCamelCase.

all.equalWONewCache <- function(a, b) {
^~~~~~~~~~~~~~~~~~~

tests/testthat/helper-allEqual.R:4:15: style: Commas should always have a space after.

​  all.equal(a,b)
              ^

tests/testthat/test-cache.R:197:4: style: Commented code should be removed.

#b1 <- writeRaster(b1, file = tmpFile, overwrite = TRUE)
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-cache.R:215:4: style: Commented code should be removed.

#r2 <- raster(extent(0, 10, 0, 10), vals = sample(1:30, size = 100, replace = TRUE))
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-cache.R:217:4: style: Commented code should be removed.

#tmpFile2 <- tempfile()
   ^~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-cache.R:219:4: style: Commented code should be removed.

#r2 <- writeRaster(r2, filename = tmpFile2, overwrite = TRUE)
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-cache.R:231:82: style: Do not place spaces around code in parentheses or square brackets.

​  expect_true(grepl("loading cached result from previous quickFun call\\.", mess1 ))
                                                                                 ^

tests/testthat/test-cache.R:245:82: style: Do not place spaces around code in parentheses or square brackets.

​  expect_true(grepl("loading cached result from previous quickFun call\\.", mess1 ))
                                                                                 ^

tests/testthat/test-cache.R:502:37: style: Commas should always have a space after.

​  expect_true(all.equalWONewCache(A,B))
                                    ^

tests/testthat/test-cache.R:611:1: style: Lines should not be more than 100 characters.

​  expect_true(all(unlist(lapply(c("No cacheRepo supplied. Using value in getOption\\('reproducible.cachePath'\\)",
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-cache.R:612:1: style: Lines should not be more than 100 characters.

"No cacheRepo supplied. Using value in getOption\\('reproducible.cachePath'\\)"),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-cache.R:617:1: style: Lines should not be more than 100 characters.

​  expect_true(all(grepl("No cacheRepo supplied. Using value in getOption\\('reproducible.cachePath'\\)", out)))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-cache.R:625:26: style: Put spaces around all infix operators.

​  expect_true(length(out)==1)
                        ~^~~

tests/testthat/test-cache.R:628:1: style: Lines should not be more than 100 characters.

# check that the rnorm inside "outer" returns cached value even if outer "outer" function is changed
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-cache.R:634:26: style: Put spaces around all infix operators.

​  expect_true(length(out)==1)
                        ~^~~

tests/testthat/test-cache.R:643:26: style: Put spaces around all infix operators.

​  expect_true(length(out)==0)
                        ~^~~

tests/testthat/test-cache.R:652:26: style: Put spaces around all infix operators.

​  expect_true(length(out)==0)
                        ~^~~

tests/testthat/test-cache.R:655:26: style: Put spaces around all infix operators.

​  expect_true(length(out)==1)
                        ~^~~

tests/testthat/test-cache.R:712:42: style: Put spaces around all infix operators.

​  expect_true(length(unique(bb$artifact))==1)
                                        ~^~~

tests/testthat/test-cache.R:713:42: style: Put spaces around all infix operators.

​  expect_true(length(unique(cc$artifact))==3)
                                        ~^~~

tests/testthat/test-cache.R:732:43: style: Put spaces around all infix operators.

​  expect_true(NROW(.reproEnv$cacheTimings)==3)
                                         ~^~~

tests/testthat/test-cache.R:733:43: style: Put spaces around all infix operators.

​  expect_true(NCOL(.reproEnv$cacheTimings)==4)
                                         ~^~~

tests/testthat/test-cache.R:745:15: style: Do not place spaces around code in parentheses or square brackets.

​  expect_true( (20*out1Details$objectSize[1]) < out2Details$objectSize[1])
              ^

tests/testthat/test-cache.R:745:19: style: Put spaces around all infix operators.

​  expect_true( (20*out1Details$objectSize[1]) < out2Details$objectSize[1])
                 ~^~

tests/testthat/test-examples.R:9:48: style: Opening curly braces should never go on their own line and should always be followed by a new line.

if (grepl("VIC-", Sys.info()["nodename"])) { # for debugging only
                                               ^

tests/testthat/test-examples.R:12:6: style: Commented code should be removed.

#expect_true(length(warn)>0)
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-packages.R:106:1: style: Trailing blank lines are superfluous.

^

tests/testthat/test-packages.R:107:1: style: Trailing blank lines are superfluous.

^
@coveralls

This comment has been minimized.

coveralls commented Mar 26, 2018

Coverage Status

Coverage decreased (-0.2%) to 78.95% when pulling 8062c5c on memoiseLoadFromRepo into 3cb59e3 on development.

@lintr-bot

This comment has been minimized.

lintr-bot commented Mar 27, 2018

inst/examples/example_Cache.R:171:1: style: Trailing blank lines are superfluous.

^

R/cache-helpers.R:940:3: style: Commented code should be removed.

# loadFromLocalRepoMem <- memoise::memoise(loadFromLocalRepo)
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cache-tools.R:85:9: style: Commented code should be removed.

# fn <- unique(objsDT[tagKey == "memoisedFunction", tagValue])
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cache-tools.R:87:11: style: Commented code should be removed.

#   forget(.memoisedCacheFuns[[f]])
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cache.R:151:1: style: Lines should not be more than 100 characters.

#'        object (from e.g., \code{asPath(filename)}) or it is a \code{Raster} with file-backing, then this will be
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cache.R:273:1: style: Lines should not be more than 100 characters.

if (R.version[['minor']] < 3.4) { # match.call changed how it worked between 3.3.2 and 3.4.x MUCH SLOWER
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cache.R:273:20: style: Only use double-quotes.

if (R.version[['minor']] < 3.4) { # match.call changed how it worked between 3.3.2 and 3.4.x MUCH SLOWER
                   ^~~~~~~

R/cache.R:273:37: style: Opening curly braces should never go on their own line and should always be followed by a new line.

if (R.version[['minor']] < 3.4) { # match.call changed how it worked between 3.3.2 and 3.4.x MUCH SLOWER
                                    ^

R/cache.R:289:28: style: Opening curly braces should never go on their own line and should always be followed by a new line.

if (any(!objOverride)) { # put into .reproEnv
                           ^

R/cache.R:311:26: style: Opening curly braces should never go on their own line and should always be followed by a new line.

if (any(!prevVals)){ # don't override previous values -- except for userTags
                         ^

R/cache.R:325:27: style: Opening curly braces should never go on their own line and should always be followed by a new line.

if (any(objOverride)) { # get from .reproEnv
                          ^

R/cache.R:346:13: style: Commented code should be removed.

#       rawFunName <- deparse(substitute(FUN, env = whereInStack("Cache")))
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cache.R:347:13: style: Commented code should be removed.

#       funName <- paste0("Cache_", rawFunName)
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cache.R:349:15: style: Commented code should be removed.

#         .memoisedCacheFuns[[funName]] <- CacheMem
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cache.R:353:17: style: Commented code should be removed.

#           forget(.memoisedCacheFuns[[funName]])
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cache.R:356:13: style: Commented code should be removed.

#       mc <- match.call(expand.dots = TRUE)
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cache.R:357:13: style: Commented code should be removed.

#       mc[[1]] <- as.name(funName)
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cache.R:358:13: style: Commented code should be removed.

#       mc <- as.list(mc)
            ^~~~~~~~~~~~~~~~~

R/cache.R:359:13: style: Commented code should be removed.

#       mc$quick <- NA
            ^~~~~~~~~~~~~~

R/cache.R:360:13: style: Commented code should be removed.

#       mc[[1]] <- NULL
            ^~~~~~~~~~~~~~~

R/cache.R:361:13: style: Commented code should be removed.

#       mc$userTags <- c(paste0("memoisedFunction:",funName), mc$userTags)
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cache.R:362:13: style: Commented code should be removed.

#       out <- do.call(.memoisedCacheFuns[[funName]], mc)#)
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cache.R:365:17: style: Commented code should be removed.

#           md5Hash <- searchInLocalRepo(pattern = attr(out, "tags"), repoDir = cacheRepo)
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cache.R:371:17: style: Commented code should be removed.

#           .cacheMessage("", paste("Memoised",rawFunName))
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cache.R:374:13: style: Commented code should be removed.

#       return(out)
            ^~~~~~~~~~~

R/cache.R:379:9: style: Commented code should be removed.

#   quick <- TRUE
        ^~~~~~~~~~~~~

R/cache.R:538:1: style: Lines should not be more than 100 characters.

elapsedTime = as.numeric(difftime(endHashTime, startHashTime, units = "secs")),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cache.R:553:1: style: Lines should not be more than 100 characters.

preDigestUnlistNames <- unlist(lapply(strsplit(names(preDigestUnlist), split = "\\."), tail, 1))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cache.R:556:1: style: Lines should not be more than 100 characters.

hashDetails$objSize[preDigestUnlistNames %in% hashObjectSizeNames] <- hashObjectSize[hashObjectSizeNames %in% preDigestUnlistNames]
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cache.R:563:9: style: Opening curly braces should never go on their own line and should always be followed by a new line.

​        {
        ^

R/cache.R:621:1: style: Lines should not be more than 100 characters.

elapsedTime = as.numeric(difftime(endLoadTime, startLoadTime, units = "secs")),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cache.R:738:18: style: Opening curly braces should never go on their own line and should always be followed by a new line.

if (FALSE) { # INCOMPLETE
                 ^

R/cache.R:744:58: style: Commas should always have a space after.

similarObjs <- loadFromLocalRepo(similar[1,artifact],
                                                         ^

R/cache.R:774:1: style: Lines should not be more than 100 characters.

elapsedTime = as.numeric(difftime(endRunTime, startRunTime, units = "secs")),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cache.R:782:1: style: Lines should not be more than 100 characters.

# on.exit({message("Running ", functionDetails$functionName, " took ", format(endRunTime - startRunTime))},
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cache.R:913:1: style: Lines should not be more than 100 characters.

elapsedTime = as.numeric(difftime(endSaveTime, startSaveTime, units = "secs")),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cache.R:975:3: style: Commented code should be removed.

# .memoisedCacheFuns <- new.env(parent = asNamespace("reproducible"))
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cache.R:976:3: style: Commented code should be removed.

# CacheMem <- memoise::memoise(Cache)
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/cache.R:978:34: style: Place a space before left parenthesis, except in a function call.

​.formalsCache <- formals(Cache)[-(1:2)]
                                 ^

R/objectSize.R:29:1: style: Variable or function name should be lowerCamelCase.

objSize.list <- function(x, quick = getOption("reproducible.quick", FALSE)) {
^~~~~~~~~~~~

R/objectSize.R:36:1: style: Variable or function name should be lowerCamelCase.

objSize.environment <- function(x, quick = getOption("reproducible.quick", FALSE)) {
^~~~~~~~~~~~~~~~~~~

R/objectSize.R:47:1: style: Variable or function name should be lowerCamelCase.

objSize.default <- function(x, quick = getOption("reproducible.quick", FALSE)) {
^~~~~~~~~~~~~~~

R/objectSize.R:53:1: style: Variable or function name should be lowerCamelCase.

objSize.Path <- function(x, quick = getOption("reproducible.quick", FALSE)) {
^~~~~~~~~~~~

R/packages.R:121:29: style: Opening curly braces should never go on their own line and should always be followed by a new line.

if (is.name(subpackages)) { # single, non quoted object
                            ^

R/packages.R:123:1: style: Lines should not be more than 100 characters.

if (!exists(subpackages, envir = parent.frame())) # if it does exist, then it is not a name, but an object
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/packages.R:145:31: style: Commented code should be removed.

nonLibPathPkgs <- ips # unlist(lapply(nonLibPathPaths, dir))
                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/packages.R:502:1: style: Lines should not be more than 100 characters.

available.packagesMem <- function(contriburl, method, fields, type, filters, repos) {# This will be replaced upon first calls to
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/packages.R:502:1: style: Variable or function name should be lowerCamelCase.

available.packagesMem <- function(contriburl, method, fields, type, filters, repos) {# This will be replaced upon first calls to
^~~~~~~~~~~~~~~~~~~~~

R/packages.R:502:85: style: Opening curly braces should never go on their own line and should always be followed by a new line.

available.packagesMem <- function(contriburl, method, fields, type, filters, repos) {# This will be replaced upon first calls to
                                                                                    ^

R/packages.R:807:1: style: Lines should not be more than 100 characters.

#' @importFrom utils read.table available.packages installed.packages install.packages assignInMyNamespace
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/pipe.R:198:5: style: Commented code should be removed.

# isFirstElemAnObj <- exists(as.character(lhs[[1]][[1]]))
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/pipe.R:200:7: style: Commented code should be removed.

#   lhs[[1]] <- lhs[[1]][[1]]
      ^~~~~~~~~~~~~~~~~~~~~~~~~

R/pipe.R:217:6: style: Commented code should be removed.

#rhss[[1]] <- rhss[[1]][-2]
     ^~~~~~~~~~~~~~~~~~~~~~~~~~

R/pipe.R:254:3: style: Variable or function name should be lowerCamelCase.

RHS <- as.list(mc)[[1]]
  ^~~

R/RcppExports.R:17:11: style: Only use double-quotes.

​    .Call('_reproducible_readLinesRcppInternal', PACKAGE = 'reproducible', path)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/RcppExports.R:17:60: style: Only use double-quotes.

​    .Call('_reproducible_readLinesRcppInternal', PACKAGE = 'reproducible', path)
                                                           ^~~~~~~~~~~~~~

R/RcppExports.R:19:1: style: Trailing blank lines are superfluous.

^

tests/testthat/helper-allEqual.R:1:1: style: Variable or function name should be lowerCamelCase.

all.equalWONewCache <- function(a, b) {
^~~~~~~~~~~~~~~~~~~

tests/testthat/helper-allEqual.R:4:15: style: Commas should always have a space after.

​  all.equal(a,b)
              ^

tests/testthat/test-cache.R:197:4: style: Commented code should be removed.

#b1 <- writeRaster(b1, file = tmpFile, overwrite = TRUE)
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-cache.R:215:4: style: Commented code should be removed.

#r2 <- raster(extent(0, 10, 0, 10), vals = sample(1:30, size = 100, replace = TRUE))
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-cache.R:217:4: style: Commented code should be removed.

#tmpFile2 <- tempfile()
   ^~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-cache.R:219:4: style: Commented code should be removed.

#r2 <- writeRaster(r2, filename = tmpFile2, overwrite = TRUE)
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-cache.R:231:82: style: Do not place spaces around code in parentheses or square brackets.

​  expect_true(grepl("loading cached result from previous quickFun call\\.", mess1 ))
                                                                                 ^

tests/testthat/test-cache.R:245:82: style: Do not place spaces around code in parentheses or square brackets.

​  expect_true(grepl("loading cached result from previous quickFun call\\.", mess1 ))
                                                                                 ^

tests/testthat/test-cache.R:502:37: style: Commas should always have a space after.

​  expect_true(all.equalWONewCache(A,B))
                                    ^

tests/testthat/test-cache.R:611:1: style: Lines should not be more than 100 characters.

​  expect_true(all(unlist(lapply(c("No cacheRepo supplied. Using value in getOption\\('reproducible.cachePath'\\)",
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-cache.R:612:1: style: Lines should not be more than 100 characters.

"No cacheRepo supplied. Using value in getOption\\('reproducible.cachePath'\\)"),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-cache.R:617:1: style: Lines should not be more than 100 characters.

​  expect_true(all(grepl("No cacheRepo supplied. Using value in getOption\\('reproducible.cachePath'\\)", out)))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-cache.R:625:26: style: Put spaces around all infix operators.

​  expect_true(length(out)==1)
                        ~^~~

tests/testthat/test-cache.R:628:1: style: Lines should not be more than 100 characters.

# check that the rnorm inside "outer" returns cached value even if outer "outer" function is changed
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-cache.R:634:26: style: Put spaces around all infix operators.

​  expect_true(length(out)==1)
                        ~^~~

tests/testthat/test-cache.R:643:26: style: Put spaces around all infix operators.

​  expect_true(length(out)==0)
                        ~^~~

tests/testthat/test-cache.R:652:26: style: Put spaces around all infix operators.

​  expect_true(length(out)==0)
                        ~^~~

tests/testthat/test-cache.R:655:26: style: Put spaces around all infix operators.

​  expect_true(length(out)==1)
                        ~^~~

tests/testthat/test-cache.R:712:42: style: Put spaces around all infix operators.

​  expect_true(length(unique(bb$artifact))==1)
                                        ~^~~

tests/testthat/test-cache.R:713:42: style: Put spaces around all infix operators.

​  expect_true(length(unique(cc$artifact))==3)
                                        ~^~~

tests/testthat/test-cache.R:732:43: style: Put spaces around all infix operators.

​  expect_true(NROW(.reproEnv$cacheTimings)==4)
                                         ~^~~

tests/testthat/test-cache.R:733:43: style: Put spaces around all infix operators.

​  expect_true(NCOL(.reproEnv$cacheTimings)==4)
                                         ~^~~

tests/testthat/test-cache.R:745:15: style: Do not place spaces around code in parentheses or square brackets.

​  expect_true( (20*out1Details$objSize[1]) < out2Details$objSize[1])
              ^

tests/testthat/test-cache.R:745:19: style: Put spaces around all infix operators.

​  expect_true( (20*out1Details$objSize[1]) < out2Details$objSize[1])
                 ~^~

tests/testthat/test-examples.R:9:48: style: Opening curly braces should never go on their own line and should always be followed by a new line.

if (grepl("VIC-", Sys.info()["nodename"])) { # for debugging only
                                               ^

tests/testthat/test-examples.R:12:6: style: Commented code should be removed.

#expect_true(length(warn)>0)
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-packages.R:106:1: style: Trailing blank lines are superfluous.

^

tests/testthat/test-packages.R:107:1: style: Trailing blank lines are superfluous.

^

@eliotmcintire eliotmcintire merged commit becd52e into development Mar 27, 2018

1 of 3 checks passed

continuous-integration/appveyor/pr Waiting for AppVeyor build to complete
Details
coverage/coveralls Coverage pending from Coveralls.io
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@eliotmcintire eliotmcintire deleted the memoiseLoadFromRepo branch Mar 27, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment