Skip to content

Commit

Permalink
adds LinkingTo items to dependency reporter (resolves #303) (#319)
Browse files Browse the repository at this point in the history
  • Loading branch information
bburns632 authored Apr 19, 2024
1 parent b15ce8a commit 6c75587
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 2 deletions.
3 changes: 2 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# pkgnet (dev)
## NEW FEATURES
* `do.call` with the function argument as string will now properly appear on the function reporter. Previously, this would show as a `do.call` node with a circular reference. (#302)
* `LinkingTo:` package dependencies are now included in the `DependencyReporter` and subsequent HTML report and objects. (#319 Thanks @petergodbert !)

## CHANGES
* Updated `pkgnet-intro` vignette to include information on the Class Inheritance Reporter and other minor edits.
Expand All @@ -9,7 +10,7 @@

# pkgnet 0.4.2
## NEW FEATURES
* Node coloring in DependencyReporter (#243)
* Node coloring in `DependencyReporter` (#243)

## CHANGES
* Removed LazyData field to accomodate change in CRAN policy. (#289)
Expand Down
2 changes: 1 addition & 1 deletion R/DependencyReporter.R
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ DependencyReporter <- R6::R6Class(

public = list(

initialize = function(dep_types = c("Imports", "Depends"), installed = TRUE){
initialize = function(dep_types = c("Imports", "Depends", "LinkingTo"), installed = TRUE){

# Check inputs
assertthat::assert_that(
Expand Down
2 changes: 2 additions & 0 deletions inst/milne/DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ Imports:
Suggests:
covr,
testthat
LinkingTo:
Rcpp
License: file LICENSE
LazyData: TRUE
RoxygenNote: 6.1.1
20 changes: 20 additions & 0 deletions tests/testthat/test-DependencyReporter-network.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,23 @@ test_that('DependencyReporter extracts expected network for baseballstats', {
)
})

test_that('DependencyReporter extracts expected network for milne (with LinkingTo:)', {

testObj <- DependencyReporter$new()$set_package('milne')

# Test nodes
expect_equivalent(
object = testObj$nodes
, expected = data.table::fread(file.path('testdata', 'milne_dependency_nodes.csv'))
, ignore.col.order = TRUE
, ignore.row.order = TRUE
)

# Test edges
expect_equivalent(
object = testObj$edges
, expected = data.table::fread(file.path('testdata', 'milne_dependency_edges.csv'))
, ignore.col.order = TRUE
, ignore.row.order = TRUE
)
})
11 changes: 11 additions & 0 deletions tests/testthat/testdata/milne_dependency_edges.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
SOURCE,TARGET
Rcpp,methods
Rcpp,utils
graphics,grDevices
methods,stats
methods,utils
milne,R6
milne,Rcpp
stats,grDevices
stats,graphics
stats,utils
9 changes: 9 additions & 0 deletions tests/testthat/testdata/milne_dependency_nodes.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
node
R6
Rcpp
grDevices
graphics
methods
milne
stats
utils

0 comments on commit 6c75587

Please sign in to comment.