Skip to content

Commit

Permalink
final styling
Browse files Browse the repository at this point in the history
  • Loading branch information
Melkiades committed Aug 22, 2023
1 parent 74a156b commit 91b307b
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 18 deletions.
1 change: 0 additions & 1 deletion R/graph_methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ topological_sort <- function(graph) {
# get the descendants (all children) of node and their distances,
# given list mapping parent to children
get_descendants_distance <- function(parents_to_children, starting_node) {

# implement BFS
nodes_to_treat <- c(starting_node) # ordered queue
distances <- list()
Expand Down
2 changes: 0 additions & 2 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ check_dir_exists <- function(direc, prefix = "") {
# validate the contents of the yaml file (after conversion into R)
# return NULL if valid throw error if not
validate_staged_deps_yaml <- function(content, file_name = "") {

# A simplified schema object to capture the schema for the yaml file
# each entry of the list contains the top level field, with their name
# whether they can be NULL and their subfields. If array is TRUE then each element
Expand Down Expand Up @@ -185,7 +184,6 @@ validate_staged_deps_yaml <- function(content, file_name = "") {

# next check the contents of the fields is as expected
lapply(required_schema, function(field) {

# extract the contents for this field
sub_content <- content[[field$name]]

Expand Down
1 change: 0 additions & 1 deletion R/zzz.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ set_storage_dir <- function(storage_dir) {
}

.onLoad <- function(libname, pkgname) {

storage_dir <- getOption(
"staged.dependencies._storage_dir",
path.expand("~/.staged.dependencies")
Expand Down
2 changes: 0 additions & 2 deletions tests/testthat/test-caching.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ test_that("clear_cache", {


test_that("rec_checkout_internal_deps works (with mocking checkout)", {

# mock checkout_repo by copying the appropriate directory to the repo_dir directory
mockery::stub(rec_checkout_internal_deps, "checkout_repo", function(repo_dir, repo_url, select_ref_rule, ...) {
repo_name <- basename(repo_url)
Expand Down Expand Up @@ -108,7 +107,6 @@ test_that("rec_checkout_internal_deps works (with mocking checkout)", {
})

test_that("rec_checkout_internal_deps works for inaccessible repos (with mocking checkout)", {

# mock checkout_repo by copying the appropriate directory to the repo_dir directory
# but stageddeps.water is not accessible
mockery::stub(rec_checkout_internal_deps, "checkout_repo", function(repo_dir, repo_url, select_ref_rule, ...) {
Expand Down
14 changes: 7 additions & 7 deletions tests/testthat/test-dependencies.R
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,6 @@ test_that("build_check_install works", {


test_that("get_all_external_deps works", {

# dummy dependency_structure object

deps <- list(
Expand Down Expand Up @@ -368,12 +367,13 @@ test_that("get_all_external_deps works", {
expect_equal(results, c("Q", "W", "U", "X", "V", "Y", "T", "Z", "S"))

# message and unsorted list if not all of Depends, Imports and LinkingTo are `from_external_dependencies`
expect_message(results <- get_all_external_dependencies(x,
package_list = "B",
available_packages = available_packages,
from_external_dependencies = c("Depends", "Imports")
),
regexp = "Packages will not be ordered as this requires"
expect_message(
results <- get_all_external_dependencies(x,
package_list = "B",
available_packages = available_packages,
from_external_dependencies = c("Depends", "Imports")
),
regexp = "Packages will not be ordered as this requires"
)

expect_equal(sort(results), c("T", "Z"))
Expand Down
2 changes: 0 additions & 2 deletions tests/testthat/test-dependencies_helper.R
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ test_that("yaml_from_dep_table works", {


test_that("parse_remote_project works", {

# repo@host
expect_equal(
parse_remote_project("x@y"),
Expand Down Expand Up @@ -229,7 +228,6 @@ test_that("run_package_actions works", {

# parse_deps_table ----
test_that("parse_deps_table works as expected", {

# empty/NA returns character(0)
expect_length(parse_deps_table(""), 0)
expect_length(parse_deps_table(NA), 0)
Expand Down
8 changes: 6 additions & 2 deletions tests/testthat/test-utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,12 @@ test_that("rep_with_names works", {
})

test_that("setting verbosity works", {
f <- function() return(verbose_sd_get())
f2 <- function() return(f())
f <- function() {
return(verbose_sd_get())
}
f2 <- function() {
return(f())
}
expect_identical(f2(), 1) # Default

# Assignment
Expand Down
7 changes: 6 additions & 1 deletion tests/testthat/test-zzz.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ test_that("setup_storage_dir works", {
# modify storage directory to a new random one
new_storage_dir <- tempfile("random_storage_dir")
set_storage_dir(new_storage_dir)
on.exit({setup_storage_dir(TESTS_STORAGE_DIR)}, add = TRUE)
on.exit(
{
setup_storage_dir(TESTS_STORAGE_DIR)
},
add = TRUE
)
setup_storage_dir(new_storage_dir)

expect_equal(get_storage_dir(), new_storage_dir)
Expand Down

0 comments on commit 91b307b

Please sign in to comment.