Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 1a10623
Showing
73 changed files
with
12,159 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
Package: PaRe | ||
Type: Package | ||
Title: A Way to Perform Code Review or QA on Other Packages | ||
Version: 0.1.6 | ||
Language: en-US | ||
Authors@R: | ||
person("Maarten", "van Kessel", email = "m.l.vankessel@erasmusmc.nl", | ||
role = c("aut", "cre")) | ||
Description: Reviews other packages during code review by looking at their | ||
dependencies, code style, code complexity, and how internally defined | ||
functions interact with one another. | ||
License: Apache License (>= 2) | ||
Encoding: UTF-8 | ||
RoxygenNote: 7.2.3 | ||
Imports: cli, cyclocomp, desc, DiagrammeR, DiagrammeRsvg, dplyr, glue, | ||
lintr, magrittr, pak, rmarkdown, rsvg, stringr, igraph, utils, | ||
R6, git2r, checkmate | ||
Suggests: ggplot2, plotly, ggraph, DT, magick, withr, cowplot, knitr | ||
VignetteBuilder: knitr | ||
NeedsCompilation: no | ||
Packaged: 2023-06-01 12:52:15 UTC; mvankessel | ||
Author: Maarten van Kessel [aut, cre] | ||
Maintainer: Maarten van Kessel <m.l.vankessel@erasmusmc.nl> | ||
Repository: CRAN | ||
Date/Publication: 2023-06-02 14:20:02 UTC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
1519f8c68904fd60ab2bf7cb5d98ebe7 *DESCRIPTION | ||
1f8872827c5944a4083e3a67e01f02d0 *NAMESPACE | ||
aad2cad56d82c4b5e9ee1ec417d26814 *NEWS.md | ||
5c8bca3dc5926d17a2a309d1dbc4c7bf *R/PaRe-package.R | ||
690883c60013852f5e1e67c9e1e20c61 *R/R6-Code.R | ||
9f0aa369b24fc227f2ed394b6a74331e *R/R6-File.R | ||
d25793e59157161699a9e85b28d038c3 *R/R6-Function.R | ||
c3d6fd02375b2a402a2fa2278561d38f *R/R6-Repository.R | ||
759240826d491eb327652b7ad6de4c1e *R/callInvestigators.R | ||
fbc031d8397fe8efb4d64f6cdc05c7c3 *R/checkDependencies.R | ||
52ccf7d4a66821ba4cc94aa1db884cc7 *R/countPackageLines.R | ||
37cbb3dc068ad015a9c72a647c7ca331 *R/getDefaultPermittedPackages.R | ||
e95fbb0329c0e82edd8ffd93e3bc909e *R/getDefinedFunctions.R | ||
69852b6bfc046756a05a93a2e2d3a023 *R/getFunctionDiagram.R | ||
4d443a770d57ac467518f85be4908f08 *R/getFunctionUse.R | ||
c08fe9be2825ff23a9e8e6373c72dbf2 *R/getGraphData.R | ||
104933a17bab0332671d5df4c421eaaf *R/lint.R | ||
fed35bb6ac121b590457b12920738143 *R/makeReport.R | ||
22cf21bc6d779cfaf99249dfb069aefc *R/pkgDiagram.R | ||
cf794928715019cf81bd51d467156178 *R/utils-pipe.R | ||
b2680f14304ba0e862d85ce606ebffa2 *README.md | ||
743e77e9164f0eabaeade4b1262a0267 *build/vignette.rds | ||
b29edef0eaedf18b9a00f64e65c4647c *inst/WORDLIST | ||
9c8d99b624a6acc9e819124ef5d0fa37 *inst/doc/Documentation.R | ||
3e92daaaab2b0928ef8d0d4d75b2217f *inst/doc/Documentation.Rmd | ||
f5e2df68ae4391463d9649a9f12930a8 *inst/doc/Documentation.html | ||
d62b3c4c1af50d76ef77784a8cb26bd1 *inst/img/logo.png | ||
a48bb48401b7f3d9405b85111c0a6262 *inst/rmd/ReportInjectable.Rmd | ||
70fbd9c5231bc16201c45c9c271d8f2b *inst/rmd/report.Rmd | ||
40a1c71111751992f944d14f4c839718 *inst/testScript.R | ||
1c6f840fc50c6d11fd8c53b2cedbdb65 *inst/whiteList.csv | ||
4fe9810cdec58eda3bfd93e477573bf0 *man/Code.Rd | ||
fb1c213c6b9774076e61f655dbb9afc5 *man/File.Rd | ||
e05e6a2583a3a1d45895a14c200d8487 *man/Function.Rd | ||
0b662bfc2940703b4776f7eca130e4d9 *man/PaRe-package.Rd | ||
2a106d209f264abd4bb8eba10424d299 *man/Repository.Rd | ||
9efdbb8f255557ca0e1aed582a822e4a *man/checkDependencies.Rd | ||
191038bb66a3ca92eb08629a684471fa *man/checkInstalled.Rd | ||
5d24f00a3b1c79f76e517767facab5d9 *man/countPackageLines.Rd | ||
a750171ab37365cf4e08891f31dfdef7 *man/exportDiagram.Rd | ||
d62b3c4c1af50d76ef77784a8cb26bd1 *man/figures/logo.png | ||
62e4e2187dfa893177dee47f2fc7d064 *man/functionUseGraph.Rd | ||
d9d02cef6ba33a7b26f8af5d96a43d8d *man/funsUsedInFile.Rd | ||
6c54a9011ed177bbc0b223d0d15ff0e4 *man/funsUsedInLine.Rd | ||
f8ed967e0f6c6a5b2fa9b6cb484881d2 *man/getApplyCall.Rd | ||
9b56d8b89ccfab34cbbd51ff0ae46455 *man/getApplyFromLines.Rd | ||
9449067e6d546c8e59e6263344857a4e *man/getDefaultPermittedPackages.Rd | ||
0887d0268048f11b856276cd43dbf7fc *man/getDefinedFunctions.Rd | ||
bd79616a02aeb7b24252589b8e791e44 *man/getDlplyCall.Rd | ||
db99b8a1b7df318559684f9059d18afb *man/getDlplyCallFromLines.Rd | ||
90b311a7a4cf0ac0b8e02c9aee9c3c6b *man/getDoCall.Rd | ||
25c52bd7287adcf8e95cb75210714962 *man/getDoCallFromLines.Rd | ||
3c8631da7d854f8689114201685f074d *man/getExportedFunctions.Rd | ||
999d509f746457ee6992f6a206ebb253 *man/getFunCall.Rd | ||
ad9da8b01b43dd94c4f1b6530fb61698 *man/getFunctionDiagram.Rd | ||
81bb8a731d079ef3650b8c8ba3889530 *man/getFunctionUse.Rd | ||
1704f69ebd707789588385e0e18caf77 *man/getFunsPerDefFun.Rd | ||
d14143c9b0a631d6ee07e9da956d9867 *man/getGraphData.Rd | ||
6a06c7ec69c0448aebb99477a73c2448 *man/getMultiLineFun.Rd | ||
712130e4b2595aa06645060ecf99b684 *man/getVersionDf.Rd | ||
96a5525f819d289864457554355638ee *man/graphToDot.Rd | ||
3317219e33b132612ef58ffe716c6122 *man/lintRepo.Rd | ||
1661e131088af5b3b005be41f40886f5 *man/lintScore.Rd | ||
9d46ba40fef91083f85bad7ab179f083 *man/makeGraph.Rd | ||
7a9c2b84f2d796a47a21cd5f5ed6ae21 *man/makeReport.Rd | ||
29ee7383caa7fc8c14f52bd035509064 *man/pipe.Rd | ||
5ef87067fec0edf62a0670b70e14c467 *man/pkgDiagram.Rd | ||
e0db61bd097f0f30c129ec957562e993 *man/printMessage.Rd | ||
d33e53f5d0121239eb85c6150e326189 *man/whiteList.Rd | ||
3e92daaaab2b0928ef8d0d4d75b2217f *vignettes/Documentation.Rmd | ||
08d9d6b171b970059f24dabd6c576712 *vignettes/img/glueDiagram.svg | ||
78c2ea0c0cc50c7ba60892bc9e42e460 *vignettes/img/glueGraph.png |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# Generated by roxygen2: do not edit by hand | ||
|
||
export("%>%") | ||
export(File) | ||
export(Function) | ||
export(Repository) | ||
export(checkDependencies) | ||
export(countPackageLines) | ||
export(exportDiagram) | ||
export(getDefaultPermittedPackages) | ||
export(getDefinedFunctions) | ||
export(getFunctionDiagram) | ||
export(getFunctionUse) | ||
export(getGraphData) | ||
export(lintRepo) | ||
export(lintScore) | ||
export(makeReport) | ||
export(pkgDiagram) | ||
export(whiteList) | ||
import(DiagrammeR) | ||
import(DiagrammeRsvg) | ||
import(R6) | ||
import(checkmate) | ||
import(glue) | ||
import(lintr) | ||
import(pak) | ||
import(rmarkdown) | ||
import(rsvg) | ||
import(stringr) | ||
import(utils) | ||
importFrom(cli,cli_alert) | ||
importFrom(cli,cli_alert_danger) | ||
importFrom(cli,cli_alert_info) | ||
importFrom(cli,cli_alert_warning) | ||
importFrom(cli,col_blue) | ||
importFrom(cli,col_green) | ||
importFrom(cli,col_magenta) | ||
importFrom(cli,col_red) | ||
importFrom(cli,col_yellow) | ||
importFrom(cli,style_bold) | ||
importFrom(cyclocomp,cyclocomp) | ||
importFrom(desc,description) | ||
importFrom(dplyr,arrange) | ||
importFrom(dplyr,bind_rows) | ||
importFrom(dplyr,filter) | ||
importFrom(dplyr,group_by) | ||
importFrom(dplyr,mutate) | ||
importFrom(dplyr,relocate) | ||
importFrom(dplyr,rename) | ||
importFrom(dplyr,select) | ||
importFrom(dplyr,summarise) | ||
importFrom(dplyr,tally) | ||
importFrom(dplyr,tibble) | ||
importFrom(git2r,blame) | ||
importFrom(git2r,hash) | ||
importFrom(git2r,is_empty) | ||
importFrom(git2r,pull) | ||
importFrom(git2r,tree) | ||
importFrom(igraph,V) | ||
importFrom(igraph,all_simple_paths) | ||
importFrom(igraph,graph_from_data_frame) | ||
importFrom(igraph,induced_subgraph) | ||
importFrom(igraph,write_graph) | ||
importFrom(magrittr,"%>%") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
PaRe 0.1.6 | ||
========== | ||
|
||
1. Started tracking changes in NEWS.md | ||
2. Added significant changes to documentation. | ||
3. Optimizations using R6 representations. | ||
4. Added functionality to subset package diagram | ||
5. Added git blame functionality | ||
|
||
PaRe 0.1.5 | ||
========== | ||
|
||
1. Added R6 code representations. | ||
|
||
PaRe 0.1.0 | ||
========== | ||
|
||
1. Initial transfer from DependencyReviewer to Package Reviewer. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
#' @keywords internal | ||
"_PACKAGE" | ||
|
||
## usethis namespace: start | ||
#' @import utils | ||
#' @import pak | ||
#' @import glue | ||
#' @import stringr | ||
#' @import lintr | ||
#' @import rmarkdown | ||
#' @import DiagrammeR | ||
#' @import DiagrammeRsvg | ||
#' @import rsvg | ||
#' @import R6 | ||
#' @import checkmate | ||
#' @importFrom igraph graph_from_data_frame V write_graph all_simple_paths induced_subgraph graph_from_data_frame | ||
#' @importFrom cli style_bold col_yellow col_red col_magenta col_green col_blue cli_alert_warning cli_alert_info cli_alert_danger cli_alert | ||
#' @importFrom dplyr filter tibble arrange select bind_rows select tally summarise rename relocate mutate group_by | ||
#' @importFrom git2r pull tree hash is_empty blame | ||
#' @importFrom desc description | ||
#' @importFrom magrittr %>% | ||
#' @importFrom cyclocomp cyclocomp | ||
## usethis namespace: end | ||
NULL | ||
|
||
#' whiteList | ||
#' | ||
#' data.frame containing links to csv-files which should be used to fetch | ||
#' white-listed dependencies. | ||
#' | ||
#' By default three csv's are listed: | ||
#' 1. darwin | ||
#' 2. hades | ||
#' 3. tidyverse | ||
#' | ||
#' The data.frame is locally fetched under: | ||
#' `system.file(package = "PaRe", "whiteList.csv")` | ||
#' | ||
#' Manual insertions into this data.frame can be made, or the data.frame can | ||
#' be overwritten entirely. | ||
#' | ||
#' The data.frame itself has the following structure: | ||
#' | ||
#' | column | data type | description | | ||
#' | ------- | ---------------------- | ----------- | | ||
#' | source | \link[base]{character} | name of the source | | ||
#' | link | \link[base]{character} | link or path to the csv-file | | ||
#' | package | \link[base]{character} | columnname of the package name column in the csv-file being linked to | | ||
#' | version | \link[base]{character} | columnname of the version column in the csv-file being linked to | | ||
#' | ||
#' The csv-files that are being pointed to should have the following structure: | ||
#' | ||
#' @export | ||
#' @examples | ||
#' if (interactive()) { | ||
#' # Dropping tidyverse | ||
#' whiteList <- whiteList %>% | ||
#' dplyr::filter(source != "tidyverse") | ||
#' | ||
#' # getDefaultPermittedPackages will now only use darwin and hades | ||
#' getDefaultPermittedPackages() | ||
#' } | ||
whiteList <- dplyr::tibble(read.csv( | ||
system.file(package = "PaRe", "whiteList.csv") | ||
)) | ||
|
||
utils::globalVariables(".data") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
#' @title | ||
#' R6 Code class | ||
#' | ||
#' @description | ||
#' Class representing a piece of code. | ||
#' | ||
#' @family | ||
#' Representations | ||
Code <- R6::R6Class( | ||
classname = "Code", | ||
# Public ---- | ||
public = list( | ||
#' @description | ||
#' Initializer method | ||
#' | ||
#' @param name (\link[base]{character})\cr | ||
#' Name of Code object. | ||
#' @param lines (\link[base]{character})\cr | ||
#' Vector of lines Code object. | ||
#' | ||
#' @return `invisible(self)` | ||
initialize = function(name, lines) { | ||
private$name <- name | ||
private$lines <- lines | ||
private$nLines <- length(lines) | ||
return(invisible(self)) | ||
}, | ||
|
||
#' @description | ||
#' Overload generic print, to print Code object. | ||
#' | ||
#' @param ... | ||
#' further arguments passed to or from other methods. See \link[base]{print}. | ||
#' | ||
#' @return ([base]{character}) | ||
print = function(...) { | ||
classTypes <- class(self) | ||
classTypes <- paste0(glue::glue("<{classTypes}>"), collapse = " ") | ||
|
||
cat( | ||
glue::glue( | ||
"{classTypes} | ||
Name: {private$name} | ||
# Lines: {private$nLines} | ||
" | ||
) | ||
) | ||
}, | ||
|
||
#' @description | ||
#' Get method for lines. | ||
#' | ||
#' @return (\link[base]{character})\cr | ||
#' Vector of lines in the Code object. | ||
getLines = function() { | ||
return(private$lines) | ||
}, | ||
|
||
#' @description | ||
#' Get method for number of lines. | ||
#' | ||
#' @return (\link[base]{numeric}) | ||
#' Number of lines in the Code object. | ||
getNLines = function() { | ||
return(private$nLines) | ||
}, | ||
|
||
#' @description | ||
#' Get method for Name. | ||
#' | ||
#' @return (\link[base]{character})\cr | ||
#' Name of the Code object. | ||
getName = function() { | ||
return(private$name) | ||
} | ||
), | ||
# Private ---- | ||
private = list( | ||
name = "", | ||
lines = c(), | ||
nLines = 0 | ||
) | ||
) |
Oops, something went wrong.