Skip to content
Merged

Rc #72

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: PaRe
Type: Package
Title: A Way to Perform Code Review or QA on Other Packages
Version: 0.1.15
Version: 0.1.16
Language: en-US
Authors@R:
person("Maarten", "van Kessel", email = "m.l.vankessel@erasmusmc.nl",
Expand Down
8 changes: 8 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
PaRe 0.1.16
==========
1. Use `dplyr::reframe()` instead of `dplyr::summarise()` for dplyr >= 1.2.0 compatability

PaRe 0.1.15
==========
1. Updated internal test setup

PaRe 0.1.14
==========
1. Changed tests so R-CMD-Check passes on depends-only environment
Expand Down
44 changes: 27 additions & 17 deletions R/getDefaultPermittedPackages.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,38 @@ getParDeps <- function(pkgs, nThreads) {
deps <- if (nThreads > 1) {
cl <- parallel::makeCluster(nThreads)
on.exit(parallel::stopCluster(cl = cl))
parallel::clusterEvalQ(cl = cl, expr = {library("pak", character.only = TRUE)})
parallel::clusterEvalQ(cl = cl, expr = {
library("pak", character.only = TRUE)
})

parallel::parLapply(cl = cl, X = pkgs, fun = function(pkg) {
tryCatch({
res <- pak::pkg_deps(pkg = pkg)
return(res)
}, error = function(e) {
return(NULL)
}, warning = function(w) {
return(res)
})
tryCatch(
{
res <- pak::pkg_deps(pkg = pkg)
return(res)
},
error = function(e) {
return(NULL)
},
warning = function(w) {
return(res)
}
)
})
} else {
lapply(X = pkgs, function(pkg) {
tryCatch({
res <- pak::pkg_deps(pkg = pkg)
return(res)
}, error = function(e) {
return(NULL)
}, warning = function(w) {
return(res)
})
tryCatch(
{
res <- pak::pkg_deps(pkg = pkg)
return(res)
},
error = function(e) {
return(NULL)
},
warning = function(w) {
return(res)
}
)
})
}

Expand Down
2 changes: 1 addition & 1 deletion R/lint.R
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ lintScore <- function(repo, messages) {
pct <- messages %>%
dplyr::group_by(.data$type) %>%
dplyr::tally() %>%
dplyr::summarise(.data$type, pct = round(.data$n / nLines * 100, 2))
dplyr::reframe(.data$type, pct = round(.data$n / nLines * 100, 2))

if (nrow(pct) == 0) {
message(glue::glue("{nrow(pct)} Lintr messages found"))
Expand Down
7 changes: 2 additions & 5 deletions inst/rmd/report.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,8 @@ DT::datatable(data.frame(
meanDegree = round(mean(igraph::degree(graphData)), 2),
meanDistance = round(mean(igraph::distances(graphData)), 2)
),
rownames= FALSE)
}, error = function(e) {
message("Could not get graph data with error:")
message(sprintf("\t%s", e))
})
rownames = FALSE
)
```

### Function use per dependency
Expand Down
27 changes: 16 additions & 11 deletions tests/testthat/setup.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,25 @@ path <- file.path(tempdir(), "glue")
repoCloned <- NULL

if (!is.null(curl::nslookup("captive.apple.com", error = FALSE))) {
tryCatch({
clone(
url = "https://github.com/tidyverse/glue",
local_path = path
)
repoCloned <- TRUE
}, error = function(e) {
repoCloned <- FALSE
})
tryCatch(
{
clone(
url = "https://github.com/tidyverse/glue",
local_path = path
)
repoCloned <- TRUE
},
error = function(e) {
repoCloned <- FALSE
}
)
} else {
repoCloned <- FALSE
}

withr::defer({
unlink(path, recursive = TRUE, force = TRUE)},
withr::defer(
{
unlink(path, recursive = TRUE, force = TRUE)
},
teardown_env()
)
9 changes: 5 additions & 4 deletions vignettes/Documentation.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,11 @@ PaRe::pkgDiagram(repo = repo) %>%
if (fetchedRepo) {
if (all(c(
require("DiagrammeRsvg", character.only = TRUE),
require("magick", character.only = TRUE)))) {
PaRe::pkgDiagram(repo = repo) %>%
DiagrammeRsvg::export_svg() %>%
magick::image_read_svg()
require("magick", character.only = TRUE)
))) {
PaRe::pkgDiagram(repo = repo) %>%
DiagrammeRsvg::export_svg() %>%
magick::image_read_svg()
}
}
```
Expand Down
Loading