├── vignettes ├── .gitignore ├── assets │ ├── clone.png │ ├── enabled_gh.png │ ├── manual_gh.png │ ├── renviron.png │ └── select_gh.png ├── editors.Rmd ├── publish-review-on-github.Rmd └── get_started.Rmd ├── LICENSE ├── R ├── pkgreviewr-package.R ├── rmd-utils.R ├── style.R ├── utils.R ├── github.R ├── render-templates.R └── pkgreview.R ├── inst ├── assets │ └── proj_structure.png ├── templates │ ├── readme-rmd-pre-commit.sh │ ├── review-README │ ├── request │ ├── pkgreview.md │ ├── editor-index │ └── review-index └── examples │ ├── example-README.md │ ├── example-pkgreview.md │ └── example-review-index.Rmd ├── man ├── figures │ └── README-pressure-1.png ├── pkgreview_print_source.Rd ├── render_request.Rd ├── use_onboarding_tmpl.Rd ├── pkgreviewr-package.Rd ├── pkgreview_index_rmd.Rd ├── pkgreview_getdata.Rd ├── pkgreview_create.Rd └── pkgreview_init.Rd ├── tests ├── testthat.R └── testthat │ ├── test-render-templates.R │ ├── setup.R │ ├── test-setup.R │ ├── test-gh-calls.R │ └── test-create-pkgreview.R ├── .gitignore ├── codecov.yml ├── .Rbuildignore ├── NAMESPACE ├── tic.R ├── _pkgdown.yml ├── .travis.yml ├── NEWS.md ├── DESCRIPTION ├── CODE_OF_CONDUCT.md ├── appveyor.yml ├── CONTRIBUTING.md ├── README.md └── LICENSE.md /vignettes/.gitignore: -------------------------------------------------------------------------------- 1 | *.html 2 | *.R 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | YEAR: 2018 2 | COPYRIGHT HOLDER: Anna Krystalli 3 | -------------------------------------------------------------------------------- /R/pkgreviewr-package.R: -------------------------------------------------------------------------------- 1 | #' @keywords internal 2 | "_PACKAGE" 3 | -------------------------------------------------------------------------------- /vignettes/assets/clone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevrome/pkgreviewr/master/vignettes/assets/clone.png -------------------------------------------------------------------------------- /inst/assets/proj_structure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevrome/pkgreviewr/master/inst/assets/proj_structure.png -------------------------------------------------------------------------------- /vignettes/assets/enabled_gh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevrome/pkgreviewr/master/vignettes/assets/enabled_gh.png -------------------------------------------------------------------------------- /vignettes/assets/manual_gh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevrome/pkgreviewr/master/vignettes/assets/manual_gh.png -------------------------------------------------------------------------------- /vignettes/assets/renviron.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevrome/pkgreviewr/master/vignettes/assets/renviron.png -------------------------------------------------------------------------------- /vignettes/assets/select_gh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevrome/pkgreviewr/master/vignettes/assets/select_gh.png -------------------------------------------------------------------------------- /man/figures/README-pressure-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevrome/pkgreviewr/master/man/figures/README-pressure-1.png -------------------------------------------------------------------------------- /tests/testthat.R: -------------------------------------------------------------------------------- 1 | library(testthat) 2 | library(pkgreviewr) 3 | library(magrittr) 4 | library(rstudioapi) 5 | 6 | test_check("pkgreviewr") 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .Rproj.user 2 | .Rhistory 3 | .RData 4 | .Ruserdata 5 | *Rproj 6 | dev/* 7 | .DS_Store 8 | assets/ 9 | !vignettes/assets/ 10 | !docs/articles/assets/ 11 | inst/doc 12 | -------------------------------------------------------------------------------- /codecov.yml: -------------------------------------------------------------------------------- 1 | comment: false 2 | 3 | coverage: 4 | status: 5 | project: 6 | default: 7 | target: auto 8 | threshold: 1% 9 | patch: 10 | default: 11 | target: auto 12 | threshold: 1% 13 | -------------------------------------------------------------------------------- /.Rbuildignore: -------------------------------------------------------------------------------- 1 | ^CONTRIBUTING\.md$ 2 | ^CODE_OF_CONDUCT\.md$ 3 | ^_pkgdown\.yml$ 4 | ^tic\.R$ 5 | ^appveyor\.yml$ 6 | ^.*\.Rproj$ 7 | ^\.Rproj\.user$ 8 | ^LICENSE\.md$ 9 | ^README\.Rmd$ 10 | ^index\.Rmd$ 11 | ^index\.md$ 12 | ^pkgreview\.md$ 13 | ^\.travis\.yml$ 14 | ^codecov\.yml$ 15 | ^dev$ 16 | ^docs$ 17 | -------------------------------------------------------------------------------- /NAMESPACE: -------------------------------------------------------------------------------- 1 | # Generated by roxygen2: do not edit by hand 2 | 3 | export(pkgreview_create) 4 | export(pkgreview_index_rmd) 5 | export(pkgreview_init) 6 | export(pkgreview_print_source) 7 | export(pkgreview_readme_md) 8 | export(pkgreview_request) 9 | export(render_request) 10 | export(use_onboarding_tmpl) 11 | importFrom(magrittr,"%>%") 12 | -------------------------------------------------------------------------------- /tests/testthat/test-render-templates.R: -------------------------------------------------------------------------------- 1 | context("test-render-templates.R") 2 | 3 | library(pkgreviewr) 4 | 5 | test_that("template-paths-resolve",{ 6 | expect_true( 7 | system.file("templates", 8 | template_name = "review-README", 9 | package = "pkgreviewr") != "") 10 | expect_true( 11 | system.file("templates", 12 | template_name = "review-index", 13 | package = "pkgreviewr") != "") 14 | }) 15 | -------------------------------------------------------------------------------- /tests/testthat/setup.R: -------------------------------------------------------------------------------- 1 | options(usethis.quiet = TRUE) 2 | detach("package:pkgreviewr", unload=TRUE) 3 | library(pkgreviewr) 4 | library(rstudioapi) 5 | 6 | # set test parameters 7 | pkg_repo <- "annakrystalli/rdflib" 8 | 9 | review_parent <- file.path(tempdir(), "pkgreviewr_test") 10 | dir.create(review_parent, showWarnings = F) 11 | review_dir <- file.path(review_parent, "rdflib-review") 12 | pkg_dir <- file.path(review_parent, "rdflib") 13 | 14 | 15 | #pkgreview_create(pkg_repo, review_parent, template = "editor") 16 | -------------------------------------------------------------------------------- /inst/templates/readme-rmd-pre-commit.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | README=($(git diff --cached --name-only | grep -Ei '^index\.[R]?md$')) 3 | MSG="use 'git commit --no-verify' to override this check" 4 | 5 | if [[ ${#index[@]} == 0 ]]; then 6 | exit 0 7 | fi 8 | 9 | if [[ index.Rmd -nt index.nb.html ]]; then 10 | echo -e "index.nb.html is out of date; please re-knit index.Rmd\n$MSG" 11 | exit 1 12 | elif [[ ${#index[@]} -lt 2 ]]; then 13 | echo -e "index.Rmd and index.nb.html should be both staged\n$MSG" 14 | exit 1 15 | fi 16 | -------------------------------------------------------------------------------- /tests/testthat/test-setup.R: -------------------------------------------------------------------------------- 1 | context("test-setup.R") 2 | 3 | test_that("check-rstudio", { 4 | expect_error(pkgreviewr:::check_rstudio()) 5 | }) 6 | 7 | test_that("missing-git-config-throws-error", { 8 | check_global_git <- pkgreviewr:::check_global_git 9 | mockery::stub(check_global_git, 10 | "try", function(){ 11 | error <- TRUE 12 | class(error) <- "try-error" 13 | error 14 | }) 15 | expect_error(check_global_git()) 16 | rm(check_global_git) 17 | }) 18 | -------------------------------------------------------------------------------- /R/rmd-utils.R: -------------------------------------------------------------------------------- 1 | #' Print review package function source code 2 | #' 3 | #' @param pkgname character string. review package name 4 | #' 5 | #' @return prints out function source code for all exported functions. 6 | #' @export 7 | #' @importFrom magrittr %>% 8 | #' @examples 9 | #' \dontrun{ 10 | #' library("pkgreviewr") 11 | #' pkgreview_print_source("pkgreviewr") 12 | #' } 13 | pkgreview_print_source <- function(pkgname){ 14 | 15 | ls(paste0("package:", pkgname)) %>% 16 | sapply(FUN = function(x){ 17 | cat(paste0("## ",x, "\n")) 18 | get(x) %>% print 19 | cat(paste0("--- \n \n"))}) 20 | } 21 | 22 | 23 | -------------------------------------------------------------------------------- /man/pkgreview_print_source.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/rmd-utils.R 3 | \name{pkgreview_print_source} 4 | \alias{pkgreview_print_source} 5 | \title{Print review package function source code} 6 | \usage{ 7 | pkgreview_print_source(pkgname) 8 | } 9 | \arguments{ 10 | \item{pkgname}{character string. review package name} 11 | } 12 | \value{ 13 | prints out function source code for all exported functions. 14 | } 15 | \description{ 16 | Print review package function source code 17 | } 18 | \examples{ 19 | \dontrun{ 20 | library("pkgreviewr") 21 | pkgreview_print_source("pkgreviewr") 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /tic.R: -------------------------------------------------------------------------------- 1 | add_package_checks() 2 | 3 | if (Sys.getenv("id_rsa") != "") { 4 | # pkgdown documentation can be built optionally. Other example criteria: 5 | # - `inherits(ci(), "TravisCI")`: Only for Travis CI 6 | # - `ci()$is_tag()`: Only for tags, not for branches 7 | # - `Sys.getenv("BUILD_PKGDOWN") != ""`: If the env var "BUILD_PKGDOWN" is set 8 | # - `Sys.getenv("TRAVIS_EVENT_TYPE") == "cron"`: Only for Travis cron jobs 9 | get_stage("before_deploy") %>% 10 | add_step(step_setup_ssh()) 11 | 12 | if (ci()$get_branch() == "master" ) { 13 | get_stage("deploy") %>% 14 | add_step(step_build_pkgdown()) %>% 15 | add_step(step_push_deploy(path = "docs", branch = "gh-pages")) 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /man/render_request.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/render-templates.R 3 | \name{render_request} 4 | \alias{render_request} 5 | \title{Render request email body} 6 | \usage{ 7 | render_request() 8 | } 9 | \value{ 10 | renders \code{request.Rmd} using parameters provided. 11 | } 12 | \description{ 13 | Launches an interactive input browser tab to complete required parameters: 14 | \itemize{ 15 | \item \code{reviewer_first_name}: reviewers first name 16 | \item \code{banter}: character string of custom greeting message 17 | \item \code{JOSS}: logical, whether review includes submission to JOSS 18 | } 19 | } 20 | \examples{ 21 | \dontrun{ 22 | render_request() 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /man/use_onboarding_tmpl.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/render-templates.R 3 | \name{use_onboarding_tmpl} 4 | \alias{use_onboarding_tmpl} 5 | \title{Create software review/editor response template} 6 | \usage{ 7 | use_onboarding_tmpl(template = c("review", "editor")) 8 | } 9 | \arguments{ 10 | \item{template}{character string, one of \code{review} or \code{editor}.} 11 | } 12 | \value{ 13 | writes a \code{{template}.md} checklist template file in the project root. 14 | } 15 | \description{ 16 | Clone an up to date copy of the specified ropensci software review/editor response template. 17 | } 18 | \examples{ 19 | \dontrun{ 20 | use_onboarding_tmpl(template = "editor") 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /inst/templates/review-README: -------------------------------------------------------------------------------- 1 | --- 2 | output: github_document 3 | --- 4 | 5 | 6 | # `{{{ Package }}}` - package review repository 7 | 8 | ## 9 | 10 | This repo contains files associated with the **rOpenSci** review of 11 | 12 | ### **`{{{ Package }}}`: ropensci/software-review** issue [\#{{{ number }}}]({{{issue_url}}}). 13 | 14 |
15 | 16 | 17 | *** 18 | 19 | ## **Reviewer:** [\@{{{whoami}}}]({{{whoami_url}}}) 20 | ### Review Submitted: 21 | **`r cat(sprintf("**Last updated:** %s", Sys.Date()))`** 22 | 23 |
24 | 25 | ### see the review report [here:]({{{index_url}}}) 26 | 27 | or view the submitted review to rOpenSci [here:]({{{pkgreview_url}}}) 28 | 29 |
30 | 31 | 32 | ## Package info 33 | 34 | **Description:** 35 | 36 | {{{Description}}} 37 | 38 | **Author:** `r {{{Authors@R}}}` 39 | 40 | **repo url:** <{{{URL}}}> 41 | 42 | **website url:** <{{{site}}}> 43 | 44 | -------------------------------------------------------------------------------- /man/pkgreviewr-package.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pkgreviewr-package.R 3 | \docType{package} 4 | \name{pkgreviewr-package} 5 | \alias{pkgreviewr} 6 | \alias{pkgreviewr-package} 7 | \title{pkgreviewr: rOpenSci package review project template} 8 | \description{ 9 | Creates files and collects materials necessary to complete an rOpenSci package review. 10 | Review files are prepopulated with review package specific metadata. Review package source code is 11 | also cloned for local testing and inspection. 12 | } 13 | \seealso{ 14 | Useful links: 15 | \itemize{ 16 | \item \url{https://github.com/ropenscilabs/pkgreviewr} 17 | \item Report bugs at \url{https://github.com/ropenscilabs/pkgreviewr/issues} 18 | } 19 | 20 | } 21 | \author{ 22 | \strong{Maintainer}: Anna Krystalli \email{annakrystalli@googlemail.com} 23 | 24 | Authors: 25 | \itemize{ 26 | \item Maëlle Salmon \email{maelle.salmon@yahoo.se} 27 | } 28 | 29 | } 30 | \keyword{internal} 31 | -------------------------------------------------------------------------------- /_pkgdown.yml: -------------------------------------------------------------------------------- 1 | navbar: 2 | structure: 3 | left: 4 | - home 5 | - getting_started 6 | - reference 7 | - articles 8 | - news 9 | right: github 10 | components: 11 | home: 12 | icon: fa-home fa-lg 13 | href: index.html 14 | getting_started: 15 | text: Getting Started 16 | href: articles/get_started.html 17 | reference: 18 | text: Reference 19 | href: reference/index.html 20 | articles: 21 | text: Articles 22 | menu: 23 | - text: Publish pkgreview on GitHub 24 | href: articles/publish-review-on-github.html 25 | - text: pkgreviewr for editors 26 | href: articles/editors.html 27 | news: 28 | text: Changelog 29 | href: news/index.html 30 | github: 31 | icon: fa-github fa-lg 32 | href: https://github.com/ropenscilabs/pkgreviewr 33 | 34 | articles: 35 | - title: All vignettes 36 | desc: ~ 37 | contents: 38 | - '`publish-review-on-github`' 39 | - '`get_started`' 40 | 41 | -------------------------------------------------------------------------------- /man/pkgreview_index_rmd.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/render-templates.R 3 | \name{pkgreview_index_rmd} 4 | \alias{pkgreview_index_rmd} 5 | \alias{pkgreview_readme_md} 6 | \alias{pkgreview_request} 7 | \title{Create review templates.} 8 | \usage{ 9 | pkgreview_index_rmd(pkg_data, template = c("review", "editor")) 10 | 11 | pkgreview_readme_md(pkg_data) 12 | 13 | pkgreview_request(pkg_data) 14 | } 15 | \arguments{ 16 | \item{pkg_data}{package metadata generated by pkgreview_getdata()} 17 | 18 | \item{template}{character string, one of \code{review} or \code{editor}.} 19 | } 20 | \description{ 21 | Creates skeleton review files: 22 | \itemize{ 23 | \item \code{index.Rmd}: \code{html_notebook} to perform and record review in 24 | \item \code{README.md}: prepopulated README for review repo. 25 | } 26 | \code{index.Rmd} will be automatically added to \code{.Rbuildignore}. The resulting templates are populated with default 27 | YAML frontmatter and R fenced code chunks (\code{Rmd}). 28 | } 29 | \examples{ 30 | \dontrun{ 31 | pkg_data <- pkgreview_getdata(pkg_dir) 32 | pkgreview_index_rmd(pkg_data) 33 | pkgreview_readme_md(pkg_data) 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /tests/testthat/test-gh-calls.R: -------------------------------------------------------------------------------- 1 | context("test-gh-calls.R") 2 | 3 | 4 | library(pkgreviewr) 5 | 6 | pkg_repo <- "annakrystalli/rdflib" 7 | 8 | test_that("check-get_repo_meta", { 9 | tr <- try(silent = TRUE, 10 | gh <- httr::GET( 11 | "https://api.github.com", 12 | httr::add_headers("user-agent" = "https://github.com/r-lib/whoami"), 13 | httr::timeout(1.0) 14 | ) 15 | ) 16 | if (inherits(tr, "try-error") || gh$status_code != 200) { 17 | skip("No internet, skipping") 18 | } 19 | 20 | meta <- get_repo_meta(pkg_repo) 21 | expect_equal(meta$name, "rdflib") 22 | expect_equal(meta$owner, "annakrystalli") 23 | expect_error(get_repo_meta("bogusrepo")) 24 | 25 | expect_identical(get_repo_meta(pkg_repo), 26 | structure(list(name = "rdflib", owner = "annakrystalli"), 27 | .Names = c("name", "owner"))) 28 | expect_identical(get_repo_meta(pkg_repo, full = T)$owner$login, "annakrystalli") 29 | 30 | }) 31 | 32 | test_that("gh_username-works", { 33 | expect_equal(gh::gh_whoami(usethis::github_token())$login, 34 | "annakrystalli") 35 | }) 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # R for travis: see documentation at https://docs.travis-ci.com/user/languages/r 2 | # Default configuration for use with tic package 3 | # Usually you shouldn't need to change the first part of the file 4 | 5 | # DO NOT CHANGE THE CODE BELOW 6 | before_install: R -q -e 'install.packages(c("remotes", "curl")); remotes::install_github("ropenscilabs/tic"); tic::prepare_all_stages(); tic::before_install()' 7 | install: R -q -e 'tic::install()' 8 | after_install: R -q -e 'tic::after_install()' 9 | before_script: R -q -e 'tic::before_script()' 10 | script: R -q -e 'tic::script()' 11 | after_success: R -q -e 'tic::after_success()' 12 | after_failure: R -q -e 'tic::after_failure()' 13 | before_deploy: R -q -e 'tic::before_deploy()' 14 | deploy: 15 | provider: script 16 | script: R -q -e 'tic::deploy()' 17 | on: 18 | all_branches: true 19 | after_deploy: R -q -e 'tic::after_deploy()' 20 | after_script: R -q -e 'tic::after_script()' 21 | # DO NOT CHANGE THE CODE ABOVE 22 | 23 | # Custom parts: 24 | 25 | # Header 26 | language: r 27 | sudo: false 28 | dist: trusty 29 | cache: packages 30 | latex: false 31 | 32 | #env 33 | env: 34 | global: 35 | - _R_CHECK_FORCE_SUGGESTS_=false 36 | - MAKEFLAGS="-j 2" 37 | 38 | #services 39 | services: 40 | -------------------------------------------------------------------------------- /NEWS.md: -------------------------------------------------------------------------------- 1 | # pkgreviewr 0.1.2 2 | 3 | * More robust project handling (thanks @rorynolan for PR) 4 | * Streamlined initialisation messages 5 | * More robust detection of gh username (thanks @benmarwick & @llrs for suggestion) and repository url 6 | 7 | # pkgreviewr 0.1.1 8 | 9 | * Added ability to specify issue_no 10 | 11 | 12 | # pkgreviewr 0.1.0 13 | 14 | * Added editor templates to enable editor checks and other duties 15 | * git2r updates resolved authentication issues so temporary workaround removed. 16 | * Functionality streamlined more stable 17 | 18 | # pkgreviewr 0.0.4 19 | 20 | * Added temporary workaround for git2r authentication issues, created by GitHub security protocol change (esp on macOSX). 21 | * `pkgreview_init()` re-instated allowing for the configuration of the review separately form the creation stage. 22 | * More isolated workflow and improved error and exception handling 23 | 24 | 25 | 26 | # pkgreviewr 0.0.3 27 | 28 | * Added a `NEWS.md` file to track changes to the package. 29 | * Added package level documentation 30 | * Combined `pkgreview_create()` and `pkgreview_init()` 31 | 32 | 33 | # pkgreviewr 0.0.2 34 | 35 | * Addressed initial installation bugs. 36 | * Added checks for Rstudio and GitHub credentials 37 | 38 | 39 | # pkgreviewr 0.0.1 40 | 41 | * Initial prototype 42 | 43 | -------------------------------------------------------------------------------- /R/style.R: -------------------------------------------------------------------------------- 1 | # from usethis commit no: https://github.com/r-lib/usethis/commit/3cc50ae7c4877d5f10747d0e8f25469897206cfe 2 | bullet <- function(line, bullet) { 3 | line <- paste0(bullet, " ", line) 4 | cat_line(line) 5 | } 6 | 7 | todo_bullet <- function() crayon::red(clisymbols::symbol$bullet) 8 | 9 | todo <- function(...) { 10 | bullet(paste0(...), bullet = todo_bullet()) 11 | } 12 | done <- function(...) { 13 | bullet(paste0(...), bullet = crayon::green(clisymbols::symbol$tick)) 14 | } 15 | 16 | code_block <- function(..., copy = interactive()) { 17 | block <- paste0(" ", c(...), collapse = "\n") 18 | if (copy && clipr::clipr_available()) { 19 | clipr::write_clip(paste0(c(...), collapse = "\n")) 20 | message("Copying code to clipboard:") 21 | } 22 | cat_line(crayon::make_style("darkgrey")(block)) 23 | } 24 | 25 | cat_line <- function(...) { 26 | cat(..., "\n", sep = "") 27 | } 28 | 29 | field <- function(...) { 30 | x <- paste0(...) 31 | crayon::green(x) 32 | } 33 | value <- function(...) { 34 | x <- paste0(...) 35 | crayon::blue(encodeString(x, quote = "'")) 36 | } 37 | 38 | code <- function(...) { 39 | x <- paste0(...) 40 | crayon::make_style("darkgrey")(encodeString(x, quote = "`")) 41 | } 42 | 43 | collapse <- function(x, sep = ", ") { 44 | paste0(x, collapse = sep) 45 | } 46 | -------------------------------------------------------------------------------- /man/pkgreview_getdata.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pkgreview.R 3 | \name{pkgreview_getdata} 4 | \alias{pkgreview_getdata} 5 | \title{pkgreview_getdata} 6 | \usage{ 7 | pkgreview_getdata(pkg_dir = NULL, pkg_repo, template = c("review", 8 | "editor"), issue_no = NULL) 9 | } 10 | \arguments{ 11 | \item{pkg_dir}{path to package source directory, cloned from github. Defaults 12 | to the package source code directory in the review parent.} 13 | 14 | \item{pkg_repo}{character string of the repo owner and name in the form of 15 | \code{"owner/repo"}.} 16 | 17 | \item{template}{character string, one of \code{review} or \code{editor}.} 18 | 19 | \item{issue_no}{integer. Issue number of the pkg review in the rOpenSci \href{https://github.com/ropensci/software-review/issues}{software-review repository}. 20 | If \code{NULL} (default), the issue number is extracted from the rOpenSci \strong{Under Review} badge on the pkg repository README. 21 | Supplying an integer to \code{issue_no} overrides this behaviour and can be useful if a badge has not been added to the README yet.} 22 | } 23 | \value{ 24 | a list of package metadata 25 | } 26 | \description{ 27 | get package metadata from package source code. 28 | } 29 | \examples{ 30 | \dontrun{ 31 | # run from within a pkgreviewr project with the package source code in a 32 | sibling directory 33 | pkgreview_getdata("../rdflib") 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /DESCRIPTION: -------------------------------------------------------------------------------- 1 | Package: pkgreviewr 2 | Type: Package 3 | Title: rOpenSci package review project template 4 | Version: 0.1.2 5 | Authors@R: c(person("Anna", "Krystalli", email = "annakrystalli@googlemail.com", 6 | role = c("aut", "cre")), 7 | person("Maëlle", "Salmon", email = "maelle.salmon@yahoo.se", role = "aut")) 8 | Description: Creates files and collects materials necessary to complete an rOpenSci package review. 9 | Review files are prepopulated with review package specific metadata. Review package source code is 10 | also cloned for local testing and inspection. 11 | License: GPL-3 + file LICENSE 12 | URL: https://github.com/ropenscilabs/pkgreviewr 13 | BugReports: https://github.com/ropenscilabs/pkgreviewr/issues 14 | Encoding: UTF-8 15 | LazyData: true 16 | Imports: 17 | devtools, 18 | git2r (>= 0.23.0), 19 | usethis (>= 1.2.0), 20 | here, 21 | reprex, 22 | gh, 23 | base64enc, 24 | magrittr, 25 | covr, 26 | goodpractice, 27 | assertthat, 28 | httr, 29 | rstudioapi, 30 | clipr, 31 | clisymbols, 32 | crayon, 33 | dplyr, 34 | glue, 35 | fs (>= 1.3.1), 36 | shiny, 37 | withr 38 | Suggests: 39 | testthat, 40 | mockery, 41 | knitr, 42 | rmarkdown 43 | RoxygenNote: 6.1.1 44 | Remotes: 45 | ropensci/git2r 46 | VignetteBuilder: knitr 47 | Roxygen: list(markdown = TRUE) 48 | Date: 2019-01-01 49 | 50 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Code of Conduct 2 | 3 | As contributors and maintainers of this project, we pledge to respect all people who 4 | contribute through reporting issues, posting feature requests, updating documentation, 5 | submitting pull requests or patches, and other activities. 6 | 7 | We are committed to making participation in this project a harassment-free experience for 8 | everyone, regardless of level of experience, gender, gender identity and expression, 9 | sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion. 10 | 11 | Examples of unacceptable behavior by participants include the use of sexual language or 12 | imagery, derogatory comments or personal attacks, trolling, public or private harassment, 13 | insults, or other unprofessional conduct. 14 | 15 | Project maintainers have the right and responsibility to remove, edit, or reject comments, 16 | commits, code, wiki edits, issues, and other contributions that are not aligned to this 17 | Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed 18 | from the project team. 19 | 20 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by 21 | opening an issue or contacting one or more of the project maintainers. 22 | 23 | This Code of Conduct is adapted from the Contributor Covenant 24 | (http://contributor-covenant.org), version 1.0.0, available at 25 | http://contributor-covenant.org/version/1/0/0/ 26 | -------------------------------------------------------------------------------- /man/pkgreview_create.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pkgreview.R 3 | \name{pkgreview_create} 4 | \alias{pkgreview_create} 5 | \title{Create a review project.} 6 | \usage{ 7 | pkgreview_create(pkg_repo, review_parent = ".", template = c("review", 8 | "editor"), issue_no = NULL) 9 | } 10 | \arguments{ 11 | \item{pkg_repo}{character string of the repo owner and name in the form of 12 | \code{"owner/repo"}.} 13 | 14 | \item{review_parent}{directory in which to setup review project and source package 15 | source code.} 16 | 17 | \item{template}{character string, one of \code{review} or \code{editor}.} 18 | 19 | \item{issue_no}{integer. Issue number of the pkg review in the rOpenSci \href{https://github.com/ropensci/software-review/issues}{software-review repository}. 20 | If \code{NULL} (default), the issue number is extracted from the rOpenSci \strong{Under Review} badge on the pkg repository README. 21 | Supplying an integer to \code{issue_no} overrides this behaviour and can be useful if a badge has not been added to the README yet.} 22 | } 23 | \value{ 24 | setup review project with templates 25 | } 26 | \description{ 27 | Create and initialise an rOpenSci package review project 28 | } 29 | \examples{ 30 | \dontrun{ 31 | # for a review project 32 | pkgreview_create(pkg_repo = "ropensci/rdflib", review_parent = "~/Documents/reviews/") 33 | # for editors checks 34 | pkgreview_create(pkg_repo = "ropensci/rdflib", review_parent = "~/Documents/editorials/", 35 | template = "editor") 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /man/pkgreview_init.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pkgreview.R 3 | \name{pkgreview_init} 4 | \alias{pkgreview_init} 5 | \title{Initialise pkgreview} 6 | \usage{ 7 | pkgreview_init(pkg_repo, review_dir = ".", pkg_dir = NULL, 8 | template = c("review", "editor"), issue_no = NULL) 9 | } 10 | \arguments{ 11 | \item{pkg_repo}{character string of the repo owner and name in the form of 12 | \code{"owner/repo"}.} 13 | 14 | \item{review_dir}{path to the review directory. Defaults to the working directory.} 15 | 16 | \item{pkg_dir}{path to package source directory, cloned from github. Defaults 17 | to the package source code directory in the review parent.} 18 | 19 | \item{template}{character string, one of \code{review} or \code{editor}.} 20 | 21 | \item{issue_no}{integer. Issue number of the pkg review in the rOpenSci \href{https://github.com/ropensci/software-review/issues}{software-review repository}. 22 | If \code{NULL} (default), the issue number is extracted from the rOpenSci \strong{Under Review} badge on the pkg repository README. 23 | Supplying an integer to \code{issue_no} overrides this behaviour and can be useful if a badge has not been added to the README yet.} 24 | } 25 | \value{ 26 | Initialisation creates pre-populated \code{index.Rmd}, \code{pkgreview.md} and \code{README.md} documents. 27 | To initialise correctly, the function requires that the source code for the 28 | package has been cloned. This might need to be done manually if it failed 29 | during review creation. If setup is correct. 30 | } 31 | \description{ 32 | Initialise pkgreview 33 | } 34 | \examples{ 35 | \dontrun{ 36 | # run from within an uninitialised pkgreviewr project 37 | pkgreview_init(pkg_repo = "ropensci/rdflib") 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /vignettes/editors.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "pkgreviewr for editors" 3 | author: "Anna Krystalli" 4 | date: "`r Sys.Date()`" 5 | output: rmarkdown::html_vignette 6 | vignette: > 7 | %\VignetteIndexEntry{pkgreviewr for editors} 8 | %\VignetteEngine{knitr::rmarkdown} 9 | %\VignetteEncoding{UTF-8} 10 | --- 11 | 12 | ```{r setup, include = FALSE} 13 | knitr::opts_chunk$set( 14 | collapse = TRUE, 15 | comment = "#>" 16 | ) 17 | ``` 18 | 19 | 20 | `pkgreviewr` now also provides templates for editors. 21 | 22 | ```{r, eval = F} 23 | library(pkgreviewr) 24 | 25 | pkgreview_create("nldoc/nlrx", 26 | review_parent = "~/Documents/workflows/rOpenSci/editorials/", 27 | template = "editor", 28 | issue_no = 262) 29 | ``` 30 | 31 | As with initialising a review, the repo is downloaded into `review_parent`. 32 | 33 | It also creates a `pkgreviewr` project containing editor related templates: 34 | 35 | ``` 36 | . 37 | ├── editor.md 38 | ├── index.Rmd 39 | ├── nlrx-review.Rproj 40 | └── request.Rmd 41 | ``` 42 | 43 | ### `index.Rmd` 44 | 45 | Similar to a review project, `index.Rmd` is a pre-populated notebook where initial editor checks can be performed 46 | 47 | 48 | ### `editor.md` 49 | 50 | This file contains the editor checks response template 51 | 52 | ### `request.Rmd` 53 | 54 | This contains a prepopulated parametarised `.Rmd` for generating request emails. The parameters it accepts are: 55 | 56 | - person's name 57 | - some friendly banter 58 | - whether JOSS submission is involved 59 | 60 | Use: 61 | 62 | ```{r, eval=FALSE} 63 | render_request() 64 | ``` 65 | 66 | to render the document by first launching a form in the browser to enter parameter values. Alternatively, you can manually edit the YAML header with parameter values and knit. 67 | 68 | -------------------------------------------------------------------------------- /appveyor.yml: -------------------------------------------------------------------------------- 1 | # DO NOT CHANGE the "init" and "install" sections below 2 | 3 | # Download script file from GitHub 4 | init: 5 | ps: | 6 | $ErrorActionPreference = "Stop" 7 | Invoke-WebRequest http://raw.github.com/krlmlr/r-appveyor/master/scripts/appveyor-tool.ps1 -OutFile "..\appveyor-tool.ps1" 8 | Import-Module '..\appveyor-tool.ps1' 9 | 10 | install: 11 | - ps: Bootstrap 12 | - cmd: R -q -e "writeLines('options(repos = \'https://cloud.r-project.org\')', '~/.Rprofile')" 13 | - cmd: R -q -e "getOption('repos')" 14 | - cmd: R -q -e "install.packages('remotes'); remotes::install_github('ropenscilabs/tic'); tic::prepare_all_stages()" 15 | 16 | cache: 17 | - C:\RLibrary 18 | 19 | before_build: R -q -e "tic::before_install()" 20 | build_script: R -q -e "tic::install()" 21 | after_build: R -q -e "tic::after_install()" 22 | before_test: R -q -e "tic::before_script()" 23 | test_script: R -q -e "tic::script()" 24 | on_success: R -q -e "try(tic::after_success(), silent = TRUE)" 25 | on_failure: R -q -e "tic::after_failure()" 26 | before_deploy: R -q -e "tic::before_deploy()" 27 | deploy_script: R -q -e "tic::deploy()" 28 | after_deploy: R -q -e "tic::after_deploy()" 29 | on_finish: R -q -e "tic::after_script()" 30 | 31 | # Adapt as necessary starting from here 32 | 33 | #on_failure: 34 | # - 7z a failure.zip *.Rcheck\* 35 | # - appveyor PushArtifact failure.zip 36 | 37 | #environment: 38 | # GITHUB_PAT: 39 | # secure: VXO22OHLkl4YhVIomSMwCZyOTx03Xf2WICaVng9xH7gISlAg8a+qrt1DtFtk8sK5 40 | 41 | artifacts: 42 | - path: '*.Rcheck\**\*.log' 43 | name: Logs 44 | 45 | - path: '*.Rcheck\**\*.out' 46 | name: Logs 47 | 48 | - path: '*.Rcheck\**\*.fail' 49 | name: Logs 50 | 51 | - path: '*.Rcheck\**\*.Rout' 52 | name: Logs 53 | 54 | - path: '\*_*.tar.gz' 55 | name: Bits 56 | 57 | - path: '\*_*.zip' 58 | name: Bits 59 | -------------------------------------------------------------------------------- /inst/examples/example-README.md: -------------------------------------------------------------------------------- 1 | --- 2 | output: github_document 3 | --- 4 | 5 | 6 | # `rdflib` - package review repository 7 | 8 | ## 9 | 10 | This repo contains files associated with the **rOpenSci** review of 11 | 12 | ### **`rdflib`: ropensci/onboarding** issue [\#169](https://github.com/ropensci/onboarding/issues/169). 13 | 14 |
15 | 16 | 17 | *** 18 | 19 | ## **Reviewer:** [\@annakrystalli](https://github.com/annakrystalli) 20 | ### Review Submitted: 21 | **`r cat(sprintf("**Last updated:** %s", Sys.Date()))`** 22 | 23 |
24 | 25 | ### see the review report [here:](https://annakrystalli.github.io/rdflib-review/index.nb.html) 26 | 27 | or view the submiited review to rOpenSci [here:](https://github.com/annakrystalli/rdflib-review/blob/master/pkgreview.md) 28 | 29 |
30 | 31 | 32 | ## Package info 33 | 34 | **Description:** 35 | 36 | The Resource Description Framework, or 'RDF' is a widely used 37 | data representation model that forms the cornerstone of the 38 | Semantic Web. 'RDF' represents data as a graph rather than 39 | the familiar data table or rectangle of relational databases. 40 | The 'rdflib' package provides a friendly and concise user interface 41 | for performing common tasks on 'RDF' data, such as reading, writing 42 | and converting between the various serializations of 'RDF' data, 43 | including 'rdfxml', 'turtle', 'nquads', 'ntriples', and 'json-ld'; 44 | creating new 'RDF' graphs, and performing graph queries using 'SPARQL'. 45 | This package wraps the low level 'redland' R package which 46 | provides direct bindings to the 'redland' C library. Additionally, 47 | the package supports the newer and more developer friendly 48 | 'JSON-LD' format through the 'jsonld' package. The package 49 | interface takes inspiration from the Python 'rdflib' library. 50 | 51 | **Author:** `r person("Carl", "Boettiger", 52 | email = "cboettig@gmail.com", 53 | role = c("aut", "cre", "cph"), 54 | comment=c(ORCID = "0000-0002-1642-628X"))` 55 | 56 | **repo url:** 57 | 58 | **website url:** 59 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to pkgreviewr 2 | 3 | This outlines how to propose a change to pkgreviewr. For more detailed 4 | info about contributing to this, and other tidyverse packages, please see the 5 | [**development contributing guide**](https://rstd.io/tidy-contrib). 6 | 7 | ### Fixing typos 8 | 9 | Small typos or grammatical errors in documentation may be edited directly using 10 | the GitHub web interface, so long as the changes are made in the _source_ file. 11 | 12 | * YES: you edit a roxygen comment in a `.R` file below `R/`. 13 | * NO: you edit an `.Rd` file below `man/`. 14 | 15 | ### Prerequisites 16 | 17 | Before you make a substantial pull request, consider opening an issue and 18 | discussing your proposed changes. If you’ve found a 19 | bug, please create an associated issue and illustrate the bug with a minimal 20 | [reprex](https://www.tidyverse.org/help/#reprex). 21 | 22 | ### Pull request process 23 | 24 | * We recommend that you create a Git branch for each pull request (PR). 25 | * Please **branch off of and make pull requests back to branch `devel`.** 26 | * Look at the Travis and AppVeyor build status before and after making changes. 27 | The `README` should contain badges for any continuous integration services used 28 | by the package. 29 | * New code should follow the tidyverse [style guide](http://style.tidyverse.org). 30 | You can use the [styler](https://CRAN.R-project.org/package=styler) package to 31 | apply these styles, but please don't restyle code that has nothing to do with 32 | your PR. 33 | * We use [roxygen2](https://cran.r-project.org/package=roxygen2), with 34 | [Markdown syntax](https://cran.r-project.org/web/packages/roxygen2/vignettes/markdown.html), 35 | for documentation. 36 | * We use [testthat](https://cran.r-project.org/package=testthat). Contributions 37 | with test cases included are easier to accept. 38 | * For user-facing changes, add a bullet to the top of `NEWS.md` below the 39 | current development version header describing the changes made followed by your 40 | GitHub username, and links to relevant issue(s)/PR(s). 41 | 42 | ### Code of Conduct 43 | 44 | Please note that the pkgreviewr project is released with a 45 | [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By contributing to this 46 | project you agree to abide by its terms. 47 | 48 | -------------------------------------------------------------------------------- /inst/templates/request: -------------------------------------------------------------------------------- 1 | --- 2 | output: html_document 3 | params: 4 | reviewer_first_name: "Jane" 5 | banter: " " 6 | JOSS: FALSE 7 | 8 | --- 9 | 10 | Dear `r params$reviewer_first_name` 11 | 12 | Hi, this is {{{editor}}} from rOpenSci `r emo::ji("wave")`. 13 | 14 | `r params$banter` 15 | 16 | I'm writing to ask if you would be willing to review a package for rOpenSci. As you probably know, rOpenSci conducts peer review of R packages contributed to our collection in a manner similar to journals. 17 | 18 | The package is **`{{{ Package }}}`** by `r {{{Authors@R}}}`: 19 | 20 | > {{{Description}}}. 21 | 22 | 23 | You can find it on GitHub [here]({{{URL}}}). We conduct our open review process via GitHub as well, [here]({{{issue_url}}}) 24 | 25 | 26 | If you accept, note that we ask reviewers to complete reviews in three weeks. (We’ve found it takes a similar amount of time to review a package as an academic paper.) 27 | 28 | Our [reviewers guide] details what we look for in a package review, and includes links to example reviews. Our standards are detailed in our [packaging guide], and we provide a reviewer [template] for you to use. You can also use package [pkgreviewr] to help set up and guide your review. If you have questions or feedback, feel free to ask me or post to the [rOpenSci forum]. You can also try the rOpenSci slack community. If you accept to review and are not already a member of the slack community, please let me know so I can invite you. 29 | 30 | `r if(params$JOSS){"The authors have also chosen to jointly submit their package to the Journal of Open Source Software, so this package includes a short paper.md manuscript describing the software that we ask you include in your review."}` 31 | 32 | Are you able to review? If you can not, suggestions for alternate reviewers are always helpful. If I don't hear from you within a week, I will assume you are unable to 33 | review at this time. 34 | 35 | Thank you for your time. 36 | 37 | Sincerely, 38 | 39 | {{{editor}}} 40 | 41 | [reviewers guide]: https://ropensci.github.io/dev_guide/reviewerguide.html 42 | [packaging guide]: https://ropensci.github.io/dev_guide/building.html 43 | [template]: https://ropensci.github.io/dev_guide/reviewtemplate.html 44 | [rOpenSci forum]: https://discuss.ropensci.org/ 45 | [pkgreviewr]: https://github.com/ropenscilabs/pkgreviewr 46 | -------------------------------------------------------------------------------- /R/utils.R: -------------------------------------------------------------------------------- 1 | check_rstudio <- function() { 2 | # check if rstudio available 3 | if (!rstudioapi::isAvailable()) { 4 | stop(strwrap(paste("pkreviewr is designed to work with Rstudio version" , 5 | "1.0 and above.", "Please install or launch in Rstudio to proceed.", 6 | "Visit ", 7 | " to download the latest version"), prefix = "\n")) 8 | } 9 | 10 | # check rstudio version > 1.0.0 11 | rs_version <- rstudioapi::getVersion() 12 | if (rs_version < "1.0.0") { 13 | stop(strwrap(paste("pkreviewr is designed to work with notebooks in Rstudio version" , 14 | "1.0 and above.", 15 | "Please update to RStudio version 1.0 or greater to proceed.", 16 | "You are running RStudio", 17 | as.character(rs_version)), prefix = "\n")) 18 | } 19 | } 20 | 21 | # modified from usethis::use_git 22 | use_git_pkgrv <- function (path = ".", message = "Initial commit") { 23 | if (uses_git_pkgrv(path)) { 24 | return(invisible()) 25 | } 26 | done("Initialising Git repo") 27 | r <- git2r::init(path) 28 | usethis::with_project(path = path, { 29 | usethis::use_git_ignore(c(".Rhistory", ".RData", ".Rproj.user")) 30 | }) 31 | done("Adding files and committing") 32 | paths <- unlist(git2r::status(r)) 33 | git2r::add(r, paths) 34 | git2r::commit(r, message) 35 | invisible(TRUE) 36 | } 37 | 38 | # modified from usethis:::uses_git 39 | uses_git_pkgrv <- function (path) { 40 | !is.null(git2r::discover_repository(path)) 41 | } 42 | 43 | write_dir <- function(tmp_dir, out_dir){ 44 | assertthat::assert_that(dir.exists(dirname(out_dir))) 45 | 46 | dir_type <- dplyr::case_when( 47 | file.exists(file.path(tmp_dir, "DESCRIPTION")) ~ "pkg_dir", 48 | TRUE ~ "review_dir") 49 | 50 | if (!usethis:::can_overwrite(out_dir)){ 51 | message(dir_type, ":", out_dir, " already exists. Not overwitten") 52 | }else{ 53 | if (dir.exists(out_dir)) { 54 | unlink(out_dir, recursive=TRUE) 55 | } 56 | file.copy(tmp_dir, dirname(out_dir), recursive = T) 57 | done(field(dir_type), " written out successfully") 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /inst/templates/pkgreview.md: -------------------------------------------------------------------------------- 1 | ## Package Review 2 | 3 | *Please check off boxes as applicable, and elaborate in comments below. Your review is not limited to these topics, as described in the reviewer guide* 4 | 5 | - [ ] As the reviewer I confirm that there are no conflicts of interest for me to review this work (If you are unsure whether you are in conflict, please speak to your editor _before_ starting your review). 6 | 7 | #### Documentation 8 | 9 | The package includes all the following forms of documentation: 10 | 11 | - [ ] **A statement of need** clearly stating problems the software is designed to solve and its target audience in README 12 | - [ ] **Installation instructions:** for the development version of package and any non-standard dependencies in README 13 | - [ ] **Vignette(s)** demonstrating major functionality that runs successfully locally 14 | - [ ] **Function Documentation:** for all exported functions in R help 15 | - [ ] **Examples** for all exported functions in R Help that run successfully locally 16 | - [ ] **Community guidelines** including contribution guidelines in the README or CONTRIBUTING, and DESCRIPTION with `URL`, `BugReports` and `Maintainer` (which may be autogenerated via `Authors@R`). 17 | 18 | >##### For packages co-submitting to JOSS 19 | > 20 | >- [ ] The package has an **obvious research application** according to [JOSS's definition](http://joss.theoj.org/about#submission_requirements) 21 | > 22 | >The package contains a `paper.md` matching [JOSS's requirements](http://joss.theoj.org/about#paper_structure) with: 23 | > 24 | >- [ ] **A short summary** describing the high-level functionality of the software 25 | >- [ ] **Authors:** A list of authors with their affiliations 26 | >- [ ] **A statement of need** clearly stating problems the software is designed to solve and its target audience. 27 | >- [ ] **References:** with DOIs for all those that have one (e.g. papers, datasets, software). 28 | 29 | #### Functionality 30 | 31 | - [ ] **Installation:** Installation succeeds as documented. 32 | - [ ] **Functionality:** Any functional claims of the software been confirmed. 33 | - [ ] **Performance:** Any performance claims of the software been confirmed. 34 | - [ ] **Automated tests:** Unit tests cover essential functions of the package 35 | and a reasonable range of inputs and conditions. All tests pass on the local machine. 36 | - [ ] **Packaging guidelines**: The package conforms to the rOpenSci packaging guidelines 37 | 38 | #### Final approval (post-review) 39 | 40 | - [ ] **The author has responded to my review and made changes to my satisfaction. I recommend approving this package.** 41 | 42 | Estimated hours spent reviewing: 43 | 44 | --- 45 | 46 | ### Review Comments 47 | -------------------------------------------------------------------------------- /inst/examples/example-pkgreview.md: -------------------------------------------------------------------------------- 1 | ## Package Review 2 | 3 | *Please check off boxes as applicable, and elaborate in comments below. Your review is not limited to these topics, as described in the reviewer guide* 4 | 5 | - [ ] As the reviewer I confirm that there are no conflicts of interest for me to review this work (If you are unsure whether you are in conflict, please speak to your editor _before_ starting your review). 6 | 7 | #### Documentation 8 | 9 | The package includes all the following forms of documentation: 10 | 11 | - [ ] **A statement of need** clearly stating problems the software is designed to solve and its target audience in README 12 | - [ ] **Installation instructions:** for the development version of package and any non-standard dependencies in README 13 | - [ ] **Vignette(s)** demonstrating major functionality that runs successfully locally 14 | - [ ] **Function Documentation:** for all exported functions in R help 15 | - [ ] **Examples** for all exported functions in R Help that run successfully locally 16 | - [ ] **Community guidelines** including contribution guidelines in the README or CONTRIBUTING, and DESCRIPTION with `URL`, `BugReports` and `Maintainer` (which may be autogenerated via `Authors@R`). 17 | 18 | >##### For packages co-submitting to JOSS 19 | > 20 | >- [ ] The package has an **obvious research application** according to [JOSS's definition](http://joss.theoj.org/about#submission_requirements) 21 | > 22 | >The package contains a `paper.md` matching [JOSS's requirements](http://joss.theoj.org/about#paper_structure) with: 23 | > 24 | >- [ ] **A short summary** describing the high-level functionality of the software 25 | >- [ ] **Authors:** A list of authors with their affiliations 26 | >- [ ] **A statement of need** clearly stating problems the software is designed to solve and its target audience. 27 | >- [ ] **References:** with DOIs for all those that have one (e.g. papers, datasets, software). 28 | 29 | #### Functionality 30 | 31 | - [ ] **Installation:** Installation succeeds as documented. 32 | - [ ] **Functionality:** Any functional claims of the software been confirmed. 33 | - [ ] **Performance:** Any performance claims of the software been confirmed. 34 | - [ ] **Automated tests:** Unit tests cover essential functions of the package 35 | and a reasonable range of inputs and conditions. All tests pass on the local machine. 36 | - [ ] **Packaging guidelines**: The package conforms to the rOpenSci packaging guidelines 37 | 38 | #### Final approval (post-review) 39 | 40 | - [ ] **The author has responded to my review and made changes to my satisfaction. I recommend approving this package.** 41 | 42 | Estimated hours spent reviewing: 43 | 44 | --- 45 | 46 | ### Review Comments 47 | -------------------------------------------------------------------------------- /tests/testthat/test-create-pkgreview.R: -------------------------------------------------------------------------------- 1 | context("test-create-pkgreview.R") 2 | on.exit(unlink(review_parent, recursive = T)) 3 | 4 | test_that("review-proj-created-correctly", { 5 | 6 | # create review project 7 | mockery::stub(pkgreview_create,"check_rstudio", NULL) 8 | #mockery::stub(pkgreview_create,"openProject", NULL) 9 | pkgreview_create(pkg_repo, review_parent) 10 | 11 | expect_true("rdflib-review" %in% list.files(review_parent)) 12 | expect_true(git2r::in_repository(review_dir)) 13 | expect_setequal(c("index.Rmd", "README.md", "review.md"), 14 | list.files(review_dir, include.dirs = T)) 15 | expect_identical(list.files(pkg_dir), 16 | c("appveyor.yml", "codecov.yml", "codemeta.json", "DESCRIPTION", 17 | "docs", "inst", "LICENSE", "man", "NAMESPACE", "NEWS.md", "paper.bib", 18 | "paper.md", "R", "rdflib.Rproj", "README.md", "README.Rmd", "tests", 19 | "vignettes")) 20 | # expect_true("rdflib-review.Rproj" %in% list.files(review_dir)) 21 | }) 22 | 23 | test_that("get-pkg_data", { 24 | tr <- try( 25 | silent = TRUE, 26 | gh <- httr::GET( 27 | "https://api.github.com", 28 | httr::add_headers("user-agent" = "https://github.com/r-lib/whoami"), 29 | httr::timeout(1.0) 30 | ) 31 | ) 32 | 33 | if (inherits(tr, "try-error") || gh$status_code != 200) { 34 | skip("No internet, skipping") 35 | } 36 | 37 | pkg_data <- pkgreview_getdata(pkg_dir, pkg_repo) 38 | 39 | # issue_meta 40 | expect_warning(pkgreviewr:::issue_meta("cboettig/rdflibh"), "undetermined") 41 | expect_equal(pkgreviewr:::issue_meta("cboettig/rdflib"), 169) 42 | expect_equal(pkgreviewr:::issue_meta("cboettig/rdflib", "url"), 43 | "https://github.com/ropensci/onboarding/issues/169") 44 | 45 | expect_equal(pkg_data$pkg_repo, "annakrystalli/rdflib") 46 | expect_equal(pkg_data$username, "annakrystalli") 47 | expect_equal(pkg_data$index_url, "https://annakrystalli.github.io/rdflib-review/index.nb.html") 48 | expect_equal(pkg_data$review_repo, "annakrystalli/rdflib-review") 49 | expect_equal(pkg_data$pkgreview_url, "https://github.com/annakrystalli/rdflib-review/blob/master/pkgreview.md") 50 | expect_equal(pkg_data$issue_url, "https://github.com/ropensci/onboarding/issues/169") 51 | expect_equal(pkg_data$number, 169) 52 | expect_equal(pkg_data$whoami, "annakrystalli") 53 | expect_equal(pkg_data$whoami_url, "https://github.com/annakrystalli") 54 | expect_equal(pkg_data$pkg_dir, pkg_dir) 55 | expect_equal(pkg_data$Package, "rdflib") 56 | expect_equal(pkg_data$repo, "rdflib") 57 | expect_equal(pkg_data$URL, "https://github.com/annakrystalli/rdflib") 58 | expect_equal(pkg_data$site, "https://cboettig.github.io/rdflib") 59 | expect_false(pkg_data$Rmd) 60 | }) 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /R/github.R: -------------------------------------------------------------------------------- 1 | # get issue metadata 2 | issue_meta <- function(pkg_repo, parameter = c("number", "url"), strict = F){ 3 | 4 | software_review_url <- "https://github.com/ropensci/software-review/issues/" 5 | onboard_url <- "https://github.com/ropensci/onboarding/issues/" 6 | readme_url <- paste0("https://raw.githubusercontent.com/", 7 | pkg_repo,"/master/README.md") 8 | 9 | readme <- suppressMessages(httr::content(httr::GET(readme_url))) 10 | if(strict){ 11 | assertthat::assert_that(readme != "404: Not Found\n", 12 | msg = paste0(readme_url, 13 | ": \n not valid url for repo README raw text")) 14 | }else{ 15 | valid_issue <- assertthat::validate_that( 16 | readme != "404: Not Found\n", 17 | msg = "undetermined") 18 | 19 | if(valid_issue == "undetermined"){ 20 | warning(paste0(readme_url, 21 | "\n not a valid url to review pkg README raw contents 22 | ropensci onboarding issue undetermined")) 23 | return(valid_issue) 24 | } 25 | } 26 | 27 | number <- gsub("([^0-9]).*$", "", 28 | gsub(paste0("(^.*", onboard_url, "|^.*", 29 | software_review_url,")"), "", 30 | readme)) 31 | 32 | switch(match.arg(parameter), 33 | "number" = as.numeric(number), 34 | "url" = paste0(onboard_url, number)) 35 | } 36 | 37 | 38 | # check username 39 | check_global_git <- function(){ 40 | test <- try(gh::gh_whoami(usethis::github_token()), silent = T) 41 | if(class(test)[1] == "try-error"){ 42 | warning("All rOpenSci package review is conducted through GitHub. 43 | To enable correct detection of your GitHub username, 44 | a PAT, Personal Authorisation Token, needs to be set up. \n 45 | Use `usethis::browse_github_pat` to generate a PAT. \n 46 | Use `usethis::edit_r_environ` to store it as environment variable 47 | GITHUB_PAT or GITHUB_TOKEN in your .Renviron file. \n 48 | 49 | For more info, see article on publishing review on GitHub in pkgreviewr documentation.") 50 | } 51 | } 52 | 53 | clone_pkg <- function(pkg_repo, pkg_dir){ 54 | 55 | clone <- try(git2r::clone(paste0("https://github.com/", pkg_repo), 56 | pkg_dir)) 57 | 58 | if(inherits(clone, "try-error")){ 59 | warning("clone of ", pkg_repo, " unsuccesful.") 60 | todo("Try \n\n", 61 | code(paste0("git clone https://github.com/", pkg_repo), " ", pkg_dir), 62 | "\n\n in the terminal to clone pkg source code") 63 | return(FALSE) 64 | } 65 | done("Package ", field("source"), " cloned successfully") 66 | return(TRUE) 67 | } 68 | 69 | get_repo_meta <- function(pkg_repo, full = FALSE){ 70 | meta <- try(gh::gh(paste0("/repos/", pkg_repo)), silent = T) 71 | if(inherits(meta, "try-error")) { 72 | if(grepl("404", meta)){ 73 | stop("Public repo: ", pkg_repo, " not found on GitHub. 404 error") 74 | }else{ 75 | stop("Call to gh API failed with error: \n\n", meta) 76 | } 77 | } 78 | if(full){meta}else{list(name = meta$name, owner = meta$owner$login)} 79 | } 80 | 81 | 82 | -------------------------------------------------------------------------------- /R/render-templates.R: -------------------------------------------------------------------------------- 1 | #' Create review templates. 2 | #' 3 | #' Creates skeleton review files: 4 | #' \itemize{ 5 | #' \item `index.Rmd`: `html_notebook` to perform and record review in 6 | #' \item `README.md`: prepopulated README for review repo. 7 | #' } 8 | #' `index.Rmd` will be automatically added to `.Rbuildignore`. The resulting templates are populated with default 9 | #' YAML frontmatter and R fenced code chunks (`Rmd`). 10 | #' 11 | #' @param pkg_data package metadata generated by pkgreview_getdata() 12 | #' @param template character string, one of `review` or `editor`. 13 | #' 14 | #' @export 15 | # @importFrom usethis getFromNamespace check_installed 16 | # @importFrom usethis getFromNamespace render_template 17 | #' @examples 18 | #' \dontrun{ 19 | #' pkg_data <- pkgreview_getdata(pkg_dir) 20 | #' pkgreview_index_rmd(pkg_data) 21 | #' pkgreview_readme_md(pkg_data) 22 | #' } 23 | pkgreview_index_rmd <- function(pkg_data, 24 | template = c("review", "editor")) { 25 | template <- match.arg(template) 26 | 27 | usethis::use_template( 28 | glue::glue("{template}-index"), 29 | "index.Rmd", 30 | data = pkg_data, 31 | ignore = FALSE, 32 | open = FALSE, 33 | package = "pkgreviewr" 34 | ) 35 | invisible(TRUE) 36 | } 37 | 38 | #' @export 39 | #' @rdname pkgreview_index_rmd 40 | pkgreview_readme_md <- function(pkg_data) { 41 | usethis::use_template( 42 | "review-README", 43 | "README.md", 44 | data = pkg_data, 45 | ignore = FALSE, 46 | open = FALSE, 47 | package = "pkgreviewr" 48 | ) 49 | } 50 | 51 | #' Create software review/editor response template 52 | #' 53 | #' Clone an up to date copy of the specified ropensci software review/editor response template. 54 | #' @param template character string, one of `review` or `editor`. 55 | #' 56 | #' @return writes a `{template}.md` checklist template file in the project root. 57 | #' @export 58 | #' 59 | #' @examples 60 | #' \dontrun{ 61 | #' use_onboarding_tmpl(template = "editor") 62 | #' } 63 | use_onboarding_tmpl <- function(template = c("review", "editor")) { 64 | template <- match.arg(template) 65 | tmpl_txt <- gh::gh("/repos/:owner/:repo/contents/:path", 66 | owner = "ropensci", 67 | repo = "dev_guide", 68 | path = glue::glue("templates/{template}.md") 69 | ) 70 | 71 | tmpl_txt <- rawToChar(base64enc::base64decode(tmpl_txt$content)) 72 | 73 | new <- usethis::write_over( 74 | usethis::proj_path(glue::glue("{template}.md")), 75 | tmpl_txt 76 | ) 77 | invisible(new) 78 | } 79 | 80 | 81 | 82 | #' @export 83 | #' @rdname pkgreview_index_rmd 84 | pkgreview_request <- function(pkg_data) { 85 | pkg_data$editor <- gh::gh_whoami(usethis::github_token())$name 86 | 87 | usethis::use_template( 88 | "request", 89 | "request.Rmd", 90 | data = pkg_data, 91 | ignore = FALSE, 92 | open = FALSE, 93 | package = "pkgreviewr" 94 | ) 95 | } 96 | 97 | 98 | #' Render request email body 99 | #' 100 | #' Launches an interactive input browser tab to complete required parameters: 101 | #' - `reviewer_first_name`: reviewers first name 102 | #' - `banter`: character string of custom greeting message 103 | #' - `JOSS`: logical, whether review includes submission to JOSS 104 | #' @return renders `request.Rmd` using parameters provided. 105 | #' @export 106 | #' 107 | #' @examples 108 | #' \dontrun{ 109 | #' render_request() 110 | #' } 111 | render_request <- function() { 112 | rmarkdown::render(usethis::proj_path("request.Rmd"), 113 | params = "ask") 114 | } 115 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | [![lifecycle](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://www.tidyverse.org/lifecycle/#maturing) [![Travis build status](https://travis-ci.org/ropenscilabs/pkgreviewr.svg?branch=master)](https://travis-ci.org/ropenscilabs/pkgreviewr) 3 | [![codecov](https://codecov.io/gh/ropenscilabs/pkgreviewr/branch/master/graph/badge.svg)](https://codecov.io/gh/ropenscilabs/pkgreviewr) 4 | 5 | # pkgreviewr 6 | 7 | The goal of pkgreviewr is to facilitate **rOpenSci** reviewers in their package reviews. 8 | 9 | It creates a review project containing populated templates of all the files you'll need to complete your review. It also clones the source code of the package under review to a convenient location, allowing easy checking and testing. 10 | 11 | See [Getting started](articles/get_started.html) vignette for more details 12 | 13 | ## Installation 14 | 15 | You can install `pkgreviewr` from GitHub with: 16 | 17 | 18 | ``` r 19 | # install.packages("devtools") 20 | devtools::install_github("ropenscilabs/pkgreviewr") 21 | ``` 22 |
23 | 24 | ### Git 25 | 26 | `pkgreviewr` functions clone the source code of the package under review so require **Git** to be installed. 27 | 28 | ### GitHub user configuration 29 | 30 | Because rOpenSci reviews are conducted through github repository [`ropensci/software-review`](https://github.com/ropensci/software-review), **`pkgreviewr` uses your GitHub username to prepopulate various fields in the review project files**. 31 | 32 | To detect your username correctly, a PAT, Personal Authorisation Token, needs to be set up. 33 | You can use `usethis::browse_github_pat()` to generate a PAT and `usethis::edit_r_environ()` to store it as environment variable `GITHUB_PAT` or `GITHUB_TOKEN` in your .`Renviron` file. For more info, see article on publishing review on GitHub in pkgreviewr documentation. 34 | 35 | If you do not have a PAT set up, you will receive an warning and any fields related to your GitHub username will not be correctly populated. However, this shouldn't affect your ability to complete your review. 36 | 37 | 38 | ### R Notebooks 39 | 40 | The package currently also makes use of [**`R Notebooks`**](https://rmarkdown.rstudio.com/r_notebooks.html) (an RMarkdown format) and requires installation of **Rstudio version 1.0** or higher, but we are [considering offering an option to remove the requirement for RStudio](https://github.com/ropenscilabs/pkgreviewr/issues/64). 41 | 42 | *** 43 | 44 | ## Review workflow 45 | 46 |
47 | 48 | #### 1. Create and initialise review project 49 | 50 | ```r 51 | library(pkgreviewr) 52 | pkgreview_create(pkg_repo = "ropensci/rdflib", 53 | review_parent = "~/Documents/workflows/rOpenSci/reviews/") 54 | ``` 55 | 56 | The review project directory will contain all the files you'll need to complete the review and will be initialised with git. 57 | 58 | ``` 59 | rdflib-review 60 | ├── README.md 61 | ├── index.Rmd 62 | ├── pkgreview.md 63 | └── rdflib-review.Rproj 64 | ``` 65 |
66 | 67 | #### 2. Perform review 68 | 69 | Open `index.Rmd` and work through the review in the notebook. You can make notes either in `index.Rmd` or directly in the `pkgreview.md` response template. 70 | 71 |
72 | 73 | #### 3. Submit review 74 | 75 | Submit your review in the package [`ropensci/software-review`](https://github.com/ropensci/software-review/issues) issue by copying and pasting the completed `pkgreview.md` template. 76 | 77 |
78 | 79 | #### 4. Publish review* 80 | 81 | OPTIONAL: Publish your review on GitHub. See [vignette](articles/publish-review-on-github.html) for further instructions 82 | 83 |
84 | 85 | 86 | *** 87 | 88 | ## `pkgreviewr` for editors 89 | 90 | `pkgreviewr` can now also be used to set up projects for editor checks. See [`pkgreviewr` for editors](articles/editors.html) vignette. 91 | 92 | 93 | *** 94 | 95 | Please note that 'pkgreviewr' is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By contributing to this project, you agree to abide by its terms. 96 | -------------------------------------------------------------------------------- /inst/templates/editor-index: -------------------------------------------------------------------------------- 1 | --- 2 | output: 3 | html_notebook: 4 | toc: true 5 | toc_float: true 6 | editor_options: 7 | chunk_output_type: inline 8 | --- 9 | 10 | ```{r setup, include = FALSE} 11 | knitr::opts_chunk$set( 12 | collapse = TRUE, 13 | comment = "#>", 14 | fig.path = "man/figures/README-", 15 | out.width = "100%" 16 | ) 17 | 18 | library(magrittr) 19 | library(devtools) 20 | ``` 21 | 22 | # `{{{ Package }}}` - package editor checks 23 | 24 | ## **Editor:** [\@{{{whoami}}}]({{{whoami_url}}}) 25 | 26 | ### Date: 27 | **`r cat(sprintf("**Last updated:** %s", Sys.Date()))`** 28 | 29 | *** 30 | 31 |
32 | 33 | This report documents the editor checks of **rOpenSci** submitted package: 34 | 35 | ### **`{{{ Package }}}`: ropensci/software-review** issue [\#{{{ number }}}]({{{issue_url}}}). 36 | 37 |
38 | 39 | ## Package info 40 | 41 | **Description:** 42 | 43 | {{{Description}}} 44 | 45 | **Author:** `r {{{Authors@R}}}` 46 | 47 | **repo url:** <{{{URL}}}> 48 | 49 | **website url:** <{{{site}}}> 50 | 51 | ## Review info 52 | 53 | 54 | #### See [editors guidelines](https://ropensci.github.io/dev_guide/editorguide.html) for further information on the rOpenSci editors checks process. 55 | 56 | **key editor checks:** 57 | 58 | 59 | 60 | 61 | 62 | 63 | *** 64 | 65 | ### session info 66 | 67 | 68 | ```{r sessionInfo} 69 | sessionInfo() 70 | ``` 71 | 72 | 73 | ```{r pkg_dir, echo = F} 74 | pkg_dir <- "{{{pkg_dir}}}" 75 | ``` 76 | 77 | ## Test installation 78 | 79 | ### test local `{{{ Package }}}` install: 80 | 81 | ```{r test-local} 82 | install(pkg_dir, dependencies = T, build_vignettes = T) 83 | ``` 84 | 85 | ```{r github-rm} 86 | remove.packages("{{{repo}}}") 87 | ``` 88 | #### **comments:** 89 | 90 | 91 | 92 | *** 93 | 94 | ### test install of `{{{ Package }}}` from GitHub with: 95 | 96 | ```{r test-github} 97 | devtools::install_github("{{{username}}}/{{{repo}}}", dependencies = T, build_vignettes = T) 98 | ``` 99 | 100 | #### **comments:** 101 | 102 | 103 | 104 | *** 105 | 106 | 107 | 108 | ## Check package integrity 109 | 110 | ### run checks on `{{{ Package }}}` source: 111 | 112 | ```{r check-checks} 113 | devtools::check(pkg_dir) 114 | ``` 115 | #### **comments:** 116 | 117 | 118 | 119 | *** 120 | 121 | ### run tests on `{{{ Package }}}` source: 122 | 123 | ```{r check-tests} 124 | devtools::test(pkg_dir) 125 | ``` 126 | #### **comments:** 127 | 128 | 129 | 130 | *** 131 | 132 | 133 | ### check `{{{ Package }}}` for goodpractice: 134 | 135 | ```{r test-goodpractice} 136 | goodpractice::gp(pkg_dir) 137 | ``` 138 | #### **comments:** 139 | 140 | 141 | 142 | *** 143 | 144 | ## Check package metadata files 145 | 146 | ### inspect 147 | 148 | - #### [README]({{{URL}}}) 149 | - #### [DESCRIPTION]({{{URL}}}/blob/master/DESCRIPTION) 150 | 151 | ### spell check 152 | 153 | ```{r spell-check} 154 | devtools::spell_check(pkg_dir) 155 | ``` 156 | 157 | #### **comments:** 158 | 159 | 160 | 161 | *** 162 | 163 | ## Review test suite: 164 | 165 | ### test coverage 166 | 167 | ```{r pkg_coverage} 168 | covr::package_coverage(pkg_dir) 169 | 170 | ``` 171 | 172 | ### inspect [tests]({{{URL}}}/blob/master/tests/testthat) 173 | 174 | 175 | #### **comments:** 176 | 177 | 178 | 179 | 180 | *** 181 | 182 | 183 | ### Reviewer assignment response: 184 | 185 | 186 | {{{ username }}}, could you please add the rOpenSci under review badge to your README? 187 | ``` 188 | [![](https://badges.ropensci.org/{{{ number }}}_status.svg)](https://github.com/ropensci/software-review/issues/{{{ number }}}) 189 | ``` 190 | 191 | --- 192 | 193 | Reviewers: 194 | Due date: 195 | 196 | *** 197 | 198 | 199 | 200 | 201 | -------------------------------------------------------------------------------- /vignettes/publish-review-on-github.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Publish pkgreview on GitHub" 3 | author: "Anna Krystalli" 4 | date: "`r Sys.Date()`" 5 | output: rmarkdown::html_vignette 6 | vignette: > 7 | %\VignetteIndexEntry{Publish pkgreview on GitHub} 8 | %\VignetteEngine{knitr::rmarkdown} 9 | %\VignetteEncoding{UTF-8} 10 | --- 11 | 12 | ## 1. Create GitHub repo and add it as a remote to your review project 13 | 14 | Currently we've not integrated the creation of an remote GitHub repo but we're exploring this functionality also. In the mean time, you **can create a repo to publish your review in two ways:** 15 | 16 | ### Manually through GitHub 17 | 18 | 1. Head over to to your **repositories tab** on [**Github**](https://github.com). 19 | 20 | 1. Click on **New** to create a **blank** repository. 21 | - Follow naming convention `"{pkgname}-review"`. 22 | - Make sure you **don't automatically create any files on GitHub**. These will cause merge conflicts when you try to push to the remote for the first time. 23 | ![](assets/manual_gh.png) 24 | 25 | 1. Click on **Clone or download** and **copy the link** displayed 26 | 27 | ![](assets/clone.png) 28 | 29 | 1. **Open a terminal** (in Rstudio go to _Tools > Terminal > New Terminal_). In the terminal, ensure you are in the review project. 30 | 31 | 1. **Add your github repo as a remote** by running the following code in the terminal, **substituting in the link you copied** from GitHub. 32 | 33 | ``` 34 | git remote add origin 35 | git push -u origin master 36 | ``` 37 | For example, in my case I add my repo to as a remote like so: 38 | 39 | ``` 40 | git remote add origin https://github.com/annakrystalli/rdflib-review.git 41 | git push -u origin master 42 | ``` 43 | Follow any authentication steps required 44 | 45 | **** 46 | 47 | ### **Programmatically using `usethis::use_github()`** 48 | 49 | To use `usethis::use_github`, you'll need to supply a **github personal access token (PAT) token**. The easiest way to set it up for all your r workflows is to store you PAT in a `GITHUB_PAT` system variable in your [.Renviron](https://csgillespie.github.io/efficientR/3-3-r-startup.html#renviron) dotfile. To do this: 50 | 51 | 1. **Generate PAT**: use `usethis::browse_github_pat` to launch page to generate a PAT on GitHub. 52 | 53 | 2. **[Add PAT to your `.Renviron`](https://github.com/jennybc/happy-git-with-r/blob/master/81_github-api-tokens.Rmd) dot file**: Use `usethis::edit_r_environ()` to open your user level `.Renviron`, paste the copied PAT token from github and save it like so: 54 | 55 | 56 | 57 | 3. **Create Github repo & add as remote:** Now, while in your review project in Rstudio, run: 58 | 59 | ```r 60 | usethis::use_github(protocol = "https") 61 | ``` 62 | to create a github repository for your review and add it as a remote for your review project. The naming of the github repository is handled automatically. 63 | 64 |
65 | Warning! Because of ongoing big changes in dependency `git2r`, you may encounter authentication problems with `usethis::use_github()`. Refer to this discussion thread for further details. 66 |
67 | 68 |
69 | 70 | *** 71 | 72 | ## 2. Commit the review files and push them to github 73 | 74 | + In the **`git` panel** in Rstudio, **select the files you want to share on github**. You can chose to only share `index.nb.html`, the rendered report or include the `index.Rmd`. Also select `README.md` so your repository has an appropriate README from which your review can be accessed. 75 | 76 | + **Commit** the files adding an appropriate commit message 77 | 78 | + **Push** your changes to GitHub 79 | 80 |
81 | 82 | *** 83 | 84 | ## 3. Enable GitHub Pages 85 | 86 | + In your review GitHub repository click on **Settings** 87 | 88 | + Scroll down to the **GitHub Pages** section and change **Source** location to **master branch** 89 | 90 | 91 | 92 | + **Github Pages is now enabled and your report review [will be published](http://annakrystalli.me/rdflib-review/index.nb.html) at the link displayed:** 93 | 94 | 95 | -------------------------------------------------------------------------------- /vignettes/get_started.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Getting Started" 3 | date: "`r Sys.Date()`" 4 | output: rmarkdown::html_vignette 5 | vignette: > 6 | %\VignetteIndexEntry{Getting Started} 7 | %\VignetteEngine{knitr::rmarkdown} 8 | %\VignetteEncoding{UTF-8} 9 | --- 10 | 11 | ```{r setup, include = FALSE} 12 | knitr::opts_chunk$set( 13 | collapse = TRUE, 14 | comment = "#>" 15 | ) 16 | ``` 17 | 18 | ### Example 19 | 20 | This is a basic example of **setting up an rOpenSci package review project**: 21 | 22 | 23 | ### 1. create review project 24 | 25 | Create the review project, using `pkgreview_create`. The function takes arguments: 26 | 27 | * **`pkg_repo`:** the **GitHub repo** details of the **package under review** in the form `username/repo` 28 | * **`review_parent`:**, the **local directory** in which the **review project (and folder) will be created** and **package source code will be cloned into**. 29 | 30 | ``` r 31 | library(pkgreviewr) 32 | pkgreview_create(pkg_repo = "ropensci/rdflib", 33 | review_parent = "~/Documents/workflows/rOpenSci/reviews/") 34 | ``` 35 | 36 | The function creates a new review project in the `review_parent` directory following project naming convention `{pkgname}-review` and populates the review templates to create all required documents. 37 | 38 | #### review files 39 | 40 | The review project directory will contain all the files you'll need to complete the review and will be initialised with git. 41 | 42 | ``` 43 | rdflib-review 44 | ├── README.md 45 | ├── index.Rmd 46 | ├── pkgreview.md 47 | └── rdflib-review.Rproj 48 | ``` 49 | 50 | #### **`index.Rmd`** 51 | 52 | The most important file it creates is the `index.Rmd html_notebook` file. This workbook is prepopulated with all the major steps required to complete the review in an interactive document to perform and record it in. It also extracts useful links, information and parameter values. 53 | 54 | **See example [here](https://github.com/annakrystalli/pkgreviewr/blob/master/inst/examples/example-review-index.Rmd).** 55 | 56 | Once rendered to **`index.nb.html`** (`*.nb.html` is the notebook file format), this report can be pushed to GitHub for publication. 57 | 58 | #### **`pkgreview.md`** 59 | 60 | Template response form to submit to the package rOpenSci onboarding review issue. 61 | 62 | **See template [here](https://github.com/annakrystalli/pkgreviewr/blob/master/inst/examples/example-pkgreview.md)**. 63 | 64 | #### **`README.md`** 65 | 66 | Prepopulated README for the review repo that will present the repo to people navigating to it. 67 | 68 | **See example [here:](https://github.com/annakrystalli/pkgreviewr/blob/master/inst/examples/example-README.md)**. 69 | 70 | *** 71 | 72 | 73 | 74 | 75 | 76 | #### clone of package source code 77 | 78 | To enable local testing of the package, review creation also clones the review package source code into `review_parent` from the github repository defned in `pkg_repo` . This also makes it available for local review and perhaps even a pull request. Correcting typos in documentation can be a great review contribution, but first you might want to check the contributing guidelines or ask the author if they are open to such pull requests. 79 | 80 | The resulting files from a successful review project will look like this: 81 | 82 | ``` 83 | reviews 84 | ├── rdflib 85 | │   ├── DESCRIPTION 86 | │   ├── LICENSE 87 | │   ├── NAMESPACE 88 | │   ├── NEWS.md 89 | │   ├── R 90 | │   │   └── rdf.R 91 | │   ├── README.Rmd 92 | │   ├── README.md 93 | │   ├── appveyor.yml 94 | │   ├── codecov.yml 95 | │   ├── codemeta.json 96 | │   ├── docs 97 | │   │   ├── LICENSE.html 98 | │   │   ├── articles 99 | │   │   │   ├── index.html 100 | │   │   │   ├── rdflib.html 101 | │   │   │   └── rdflib_files 102 | │   │   │   ├── datatables-binding-0.2 103 | │   │   │   │   └── datatables.js 104 | │   │   │   ├── dt-core-1.10.12 105 | │   │   │   │   ├── css 106 | │   │   │   │   │   ├── jquery.dataTables.extra.css 107 | │   │   │   │   │   └── jquery.dataTables.min.css 108 | │   │   │   │   └── js 109 | │   │   │   │   └── jquery.dataTables.min.js 110 | │   │   │   ├── htmlwidgets-0.9 111 | │   │   │   │   └── htmlwidgets.js 112 | │   │   │   └── jquery-1.12.4 113 | │   │   │   ├── LICENSE.txt 114 | │   │   │   └── jquery.min.js 115 | │   │   ├── authors.html 116 | │   │   ├── index.html 117 | │   │   ├── jquery.sticky-kit.min.js 118 | │   │   ├── link.svg 119 | │   │   ├── news 120 | │   │   │   └── index.html 121 | │   │   ├── pkgdown.css 122 | │   │   ├── pkgdown.js 123 | │   │   └── reference 124 | │   │   ├── index.html 125 | │   │   ├── rdf.html 126 | │   │   ├── rdf_add.html 127 | │   │   ├── rdf_parse.html 128 | │   │   ├── rdf_query.html 129 | │   │   ├── rdf_serialize.html 130 | │   │   └── rdflib-package.html 131 | │   ├── inst 132 | │   │   ├── examples 133 | │   │   │   └── rdf_table.R 134 | │   │   └── extdata 135 | │   │   ├── ex.xml 136 | │   │   └── vita.json 137 | │   ├── man 138 | │   │   ├── rdf.Rd 139 | │   │   ├── rdf_add.Rd 140 | │   │   ├── rdf_parse.Rd 141 | │   │   ├── rdf_query.Rd 142 | │   │   ├── rdf_serialize.Rd 143 | │   │   └── rdflib-package.Rd 144 | │   ├── paper.bib 145 | │   ├── paper.md 146 | │   ├── rdflib.Rproj 147 | │   ├── tests 148 | │   │   ├── testthat 149 | │   │   │   └── test-rdf.R 150 | │   │   └── testthat.R 151 | │   └── vignettes 152 | │   └── rdflib.Rmd 153 | └── rdflib-review 154 | ├── README.md 155 | ├── index.Rmd 156 | └── rdflib-review.Rproj 157 | 158 | ``` 159 | 160 |
161 | 162 | ### 2. Perform your review: 163 | 164 | Use the index.Rmd notebook to work through the review interactively. The document is designed to guide the process in a logical fashion and bring your attention to relevant aspects and information at different stages of the review. You can make notes and record comments within index.Rmd or directly in the review submission form. 165 | 166 |
167 | 168 | ### 3. Submit your review: 169 | 170 | Currently the workflow is just set up for you to just copy your response from your completed `pkgreview.md` and paste it into the review issue but we're exploring programmatic submission also. Because the response is currently submitted as `.md`, package `reprex` might be useful for inserting reproducible demos of any issues encountered. 171 | 172 |
173 | 174 | ### 4. Publish your report by pushing to GitHub * 175 | 176 | Optional. Have a look at the **Publish pkgreview on GitHub** vignette. 177 | 178 | -------------------------------------------------------------------------------- /inst/templates/review-index: -------------------------------------------------------------------------------- 1 | --- 2 | output: 3 | html_notebook: 4 | toc: true 5 | toc_float: true 6 | editor_options: 7 | chunk_output_type: inline 8 | --- 9 | 10 | 11 | 12 | ```{r setup, include = FALSE} 13 | knitr::opts_chunk$set( 14 | collapse = TRUE, 15 | comment = "#>", 16 | fig.path = "man/figures/README-", 17 | out.width = "100%" 18 | ) 19 | 20 | library(magrittr) 21 | library(devtools) 22 | ``` 23 | 24 | # `{{{ Package }}}` - package review 25 | 26 | ## **Reviewer:** [\@{{{whoami}}}]({{{whoami_url}}}) 27 | 28 | ### Review Submitted: 29 | **`r cat(sprintf("**Last updated:** %s", Sys.Date()))`** 30 | 31 | *** 32 | 33 |
34 | 35 | This report contains documents associated with the review of **rOpenSci** submitted package: 36 | 37 | ### **`{{{ Package }}}`: ropensci/software-review** issue [\#{{{ number }}}]({{{issue_url}}}). 38 | 39 |
40 | 41 | ## Package info 42 | 43 | **Description:** 44 | 45 | {{{Description}}} 46 | 47 | **Author:** `r {{{Authors@R}}}` 48 | 49 | **repo url:** <{{{URL}}}> 50 | 51 | **website url:** <{{{site}}}> 52 | 53 | ## Review info 54 | 55 | 56 | #### See [reviewer guidelines](https://ropensci.github.io/dev_guide/reviewerguide.html) for further information on the rOpenSci review process. 57 | 58 | **key review checks:** 59 | 60 | - Does the code comply with **general principles in the [Mozilla reviewing guide](https://mozillascience.github.io/codeReview/review.html)**? 61 | - Does the package **comply with the [ROpenSci packaging guide](https://ropensci.github.io/dev_guide/building.html)**? 62 | - Are there **improvements** that could be made to the **code style?** 63 | - Is there **code duplication** in the package that should be reduced? 64 | - Are there **user interface improvements** that could be made? 65 | - Are there **performance improvements** that could be made? 66 | - Is the [**documentation**](https://ropensci.github.io/dev_guide/building.html#documentation) (installation instructions/vignettes/examples/demos) **clear and sufficient**? 67 | 68 | Please be respectful and kind to the authors in your reviews. The rOpenSci [code of conduct](https://ropensci.github.io/dev_guide/policies.html#code-of-conduct) is mandatory for everyone involved in our review process. 69 | 70 | *** 71 | 72 | ### session info 73 | 74 | 75 | ```{r sessionInfo} 76 | sessionInfo() 77 | ``` 78 | 79 | 80 | ```{r pkg_dir, echo = F} 81 | pkg_dir <- "{{{pkg_dir}}}" 82 | ``` 83 | 84 | ## Test installation 85 | 86 | ### test local `{{{ Package }}}` install: 87 | 88 | ```{r test-local} 89 | install(pkg_dir, dependencies = T, build_vignettes = T) 90 | ``` 91 | 92 | ```{r github-rm} 93 | remove.packages("{{{repo}}}") 94 | ``` 95 | #### **comments:** 96 | 97 | 98 | 99 | *** 100 | 101 | ### test install of `{{{ Package }}}` from GitHub with: 102 | 103 | ```{r test-github} 104 | devtools::install_github("{{{username}}}/{{{repo}}}", dependencies = T, build_vignettes = T) 105 | ``` 106 | 107 | #### **comments:** 108 | 109 | 110 | 111 | *** 112 | 113 | 114 | 115 | ## Check package integrity 116 | 117 | ### run checks on `{{{ Package }}}` source: 118 | 119 | ```{r check-checks} 120 | devtools::check(pkg_dir) 121 | ``` 122 | #### **comments:** 123 | 124 | 125 | 126 | *** 127 | 128 | ### run tests on `{{{ Package }}}` source: 129 | 130 | ```{r check-tests} 131 | devtools::test(pkg_dir) 132 | ``` 133 | #### **comments:** 134 | 135 | 136 | 137 | *** 138 | 139 | 140 | ### check `{{{ Package }}}` for goodpractice: 141 | 142 | ```{r test-goodpractice} 143 | goodpractice::gp(pkg_dir) 144 | ``` 145 | #### **comments:** 146 | 147 | 148 | 149 | *** 150 | 151 | ## Check package metadata files 152 | 153 | ### inspect 154 | 155 | - #### [README]({{{URL}}}) 156 | - #### [DESCRIPTION]({{{URL}}}/blob/master/DESCRIPTION) 157 | - #### [NAMESPACE]({{{URL}}}/blob/master/NAMESPACE) 158 | 159 | ### spell check 160 | 161 | ```{r spell-check} 162 | devtools::spell_check(pkg_dir) 163 | ``` 164 | 165 | #### **comments:** 166 | 167 | 168 | 169 | *** 170 | 171 | ## Check documentation 172 | 173 | online documentation: **<{{{site}}}>** 174 | 175 | * Is the [documentation](https://ropensci.github.io/dev_guide/building.html#documentation) (installation instructions/vignettes/examples/demos) clear and sufficient? 176 | 177 | ### test `{{{ Package }}}` function help files: 178 | 179 | ```{r test-help} 180 | help(package = "{{{ Package }}}") 181 | ``` 182 | 183 | #### **comments:** 184 | 185 | 186 | 187 | *** 188 | 189 | ### test `{{{ Package }}}` vignettes: 190 | 191 | ```{r test-vignettes} 192 | vignette(package = "{{{ Package }}}") 193 | ``` 194 | 195 | #### **comments:** 196 | 197 | 198 | 199 | *** 200 | 201 | ## Test functionality: 202 | 203 | - Are there **user interface improvements** that could be made? 204 | - Are there **performance improvements** that could be made? 205 | 206 | ```{r free-style} 207 | library("{{{ Package }}}") 208 | ``` 209 | 210 | ```{r parse-functions} 211 | exports <-ls("package:{{{ Package }}}") 212 | exports 213 | ``` 214 | 215 | 216 | 217 | ```{r exp-chunk} 218 | 219 | 220 | ``` 221 | 222 | #### **comments:** 223 | 224 | 225 | 226 | *** 227 | 228 | ## Inspect code: 229 | 230 | - Does the package **comply with the [ROpenSci packaging guide](https://ropensci.github.io/dev_guide/building.html)**? 231 | * good [function & variable naming?](https://ropensci.github.io/dev_guide/building.html#function-and-argument-naming) 232 | * good [dependency management](https://ropensci.github.io/dev_guide/building.html#package-dependencies)? 233 | - Are there **improvements** that could be made to the [**code style?**](https://ropensci.github.io/dev_guide/building.html#code-style) 234 | - Is there **code duplication** in the package that should be reduced? 235 | 236 | ```{r inspect-code} 237 | pkgreviewr::pkgreview_print_source("{{{ Package }}}") 238 | ``` 239 | **\* might not be suitable for large packages with many exported functions** 240 | 241 | 242 |
243 |
244 | 245 | #### **comments:** 246 | 247 | 248 | 249 | 250 | ## Review test suite: 251 | 252 | See guidance on [testing](https://ropensci.github.io/dev_guide/building.html#testing) for further details. 253 | 254 | ### test coverage 255 | 256 | ```{r pkg_coverage} 257 | covr::package_coverage(pkg_dir) 258 | 259 | ``` 260 | 261 | ### inspect [tests]({{{URL}}}/blob/master/tests/testthat) 262 | 263 | 264 | #### **comments:** 265 | 266 | 267 | 268 | 269 | *** 270 | -------------------------------------------------------------------------------- /inst/examples/example-review-index.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | output: 3 | html_notebook: 4 | toc: true 5 | toc_float: true 6 | editor_options: 7 | chunk_output_type: inline 8 | --- 9 | 10 | 11 | 12 | ```{r setup, include = FALSE} 13 | knitr::opts_chunk$set( 14 | collapse = TRUE, 15 | comment = "#>", 16 | fig.path = "man/figures/README-", 17 | out.width = "100%" 18 | ) 19 | 20 | library(magrittr) 21 | ``` 22 | 23 | # `rdflib` - package review 24 | 25 | ## **Reviewer:** [\@annakrystalli](https://github.com/annakrystalli) 26 | 27 | ### Review Submitted: 28 | **`r cat(sprintf("**Last updated:** %s", Sys.Date()))`** 29 | 30 | *** 31 | 32 |
33 | 34 | This report contains documents the review of **rOpenSci** submitted package: 35 | 36 | ### **`rdflib`: ropensci/onboarding** issue [\#169](https://github.com/ropensci/onboarding/issues/169). 37 | 38 |
39 | 40 | ## Package info 41 | 42 | **Description:** 43 | 44 | The Resource Description Framework, or 'RDF' is a widely used 45 | data representation model that forms the cornerstone of the 46 | Semantic Web. 'RDF' represents data as a graph rather than 47 | the familiar data table or rectangle of relational databases. 48 | The 'rdflib' package provides a friendly and concise user interface 49 | for performing common tasks on 'RDF' data, such as reading, writing 50 | and converting between the various serializations of 'RDF' data, 51 | including 'rdfxml', 'turtle', 'nquads', 'ntriples', and 'json-ld'; 52 | creating new 'RDF' graphs, and performing graph queries using 'SPARQL'. 53 | This package wraps the low level 'redland' R package which 54 | provides direct bindings to the 'redland' C library. Additionally, 55 | the package supports the newer and more developer friendly 56 | 'JSON-LD' format through the 'jsonld' package. The package 57 | interface takes inspiration from the Python 'rdflib' library. 58 | 59 | **Author:** `r person("Carl", "Boettiger", 60 | email = "cboettig@gmail.com", 61 | role = c("aut", "cre", "cph"), 62 | comment=c(ORCID = "0000-0002-1642-628X"))` 63 | 64 | **repo url:** 65 | 66 | **website url:** 67 | 68 | ## Review info 69 | 70 | 71 | #### See [reviewer guidelines](https://github.com/ropensci/onboarding/blob/master/reviewing_guide.md) for further information on the rOpenSci review process. 72 | 73 | **key review checks:** 74 | 75 | - Does the code comply with **general principles in the [Mozilla reviewing guide](https://mozillascience.github.io/codeReview/review.html)**? 76 | - Does the package **comply with the [ROpenSci packaging guide](https://github.com/ropensci/onboarding/blob/master/packaging_guide.md)**? 77 | - Are there **improvements** that could be made to the **code style?** 78 | - Is there **code duplication** in the package that should be reduced? 79 | - Are there **user interface improvements** that could be made? 80 | - Are there **performance improvements** that could be made? 81 | - Is the **documentation** (installation instructions/vignettes/examples/demos) **clear and sufficient**? 82 | 83 | Please be respectful and kind to the authors in your reviews. The rOpenSci [code of conduct](https://github.com/ropensci/onboarding/blob/master/policies.md/#code-of-conduct) is mandatory for everyone involved in our review process. 84 | 85 | *** 86 | 87 | ### session info 88 | 89 | 90 | ```{r sessionInfo} 91 | sessionInfo() 92 | ``` 93 | 94 | 95 | ```{r pkg_dir, echo = F} 96 | pkg_dir <- "/private/var/folders/8p/87cqdx2s34vfvcgh04l6z72w0000gn/T/Rtmp4i9nQx/rdflib-review/../rdflib" 97 | ``` 98 | 99 | ## Test installation 100 | 101 | ### test local `rdflib` install: 102 | 103 | ```{r test-local} 104 | install(pkg_dir, dependencies = T, build_vignettes = T) 105 | ``` 106 | 107 | ```{r github-rm} 108 | remove.packages("rdflib") 109 | ``` 110 | #### **comments:** 111 | 112 | 113 | 114 | *** 115 | 116 | ### test install of `rdflib` from GitHub with: 117 | 118 | ```{r test-github} 119 | devtools::install_github("cboettig/rdflib", dependencies = T, build_vignettes = T) 120 | ``` 121 | 122 | #### **comments:** 123 | 124 | 125 | 126 | *** 127 | 128 | 129 | 130 | ## Check package integrity 131 | 132 | ### run checks on `rdflib` source: 133 | 134 | ```{r check-checks} 135 | devtools::check(pkg_dir) 136 | ``` 137 | #### **comments:** 138 | 139 | 140 | 141 | *** 142 | 143 | ### run tests on `rdflib` source: 144 | 145 | ```{r check-tests} 146 | devtools::test(pkg_dir) 147 | ``` 148 | #### **comments:** 149 | 150 | 151 | 152 | *** 153 | 154 | 155 | ### check `rdflib` for goodpractice: 156 | 157 | ```{r test-goodpractice} 158 | goodpractice::gp(pkg_dir) 159 | ``` 160 | #### **comments:** 161 | 162 | 163 | 164 | *** 165 | 166 | ## Check package metadata files 167 | 168 | ### inspect 169 | 170 | - #### [README](https://github.com/cboettig/rdflib) 171 | - #### [DESCRIPTION](https://github.com/cboettig/rdflib/blob/master/DESCRIPTION) 172 | - #### [NAMESPACE](https://github.com/cboettig/rdflib/blob/master/NAMESPACE) 173 | 174 | ### spell check 175 | 176 | ```{r spell-check} 177 | devtools::spell_check(pkg_dir) 178 | ``` 179 | 180 | #### **comments:** 181 | 182 | 183 | 184 | *** 185 | 186 | ## Check documentation 187 | 188 | online documentation: **** 189 | 190 | * Is the documentation (installation instructions/vignettes/examples/demos) clear and sufficient? 191 | 192 | ### test `rdflib` function help files: 193 | 194 | ```{r test-help} 195 | help(package = "rdflib") 196 | ``` 197 | 198 | #### **comments:** 199 | 200 | 201 | 202 | *** 203 | 204 | ### test `rdflib` vignettes: 205 | 206 | ```{r test-vignettes} 207 | vignette(package = "rdflib") 208 | ``` 209 | 210 | #### **comments:** 211 | 212 | 213 | 214 | *** 215 | 216 | ## Test functionality: 217 | 218 | - Are there **user interface improvements** that could be made? 219 | - Are there **performance improvements** that could be made? 220 | 221 | ```{r free-style} 222 | library("rdflib") 223 | ``` 224 | 225 | ```{r parse-functions} 226 | exports <-ls("package:rdflib") 227 | exports 228 | ``` 229 | 230 | 231 | 232 | ```{r exp-chunk} 233 | 234 | 235 | ``` 236 | 237 | #### **comments:** 238 | 239 | 240 | 241 | *** 242 | 243 | ## Inspect code: 244 | 245 | - Does the package **comply with the [ROpenSci packaging guide](https://github.com/ropensci/onboarding/blob/master/packaging_guide.md)**? 246 | * good [function & variable naming?](https://github.com/ropensci/onboarding/blob/master/packaging_guide.md#funvar) 247 | * good [dependency management](https://github.com/ropensci/onboarding/blob/master/packaging_guide.md#deps)? 248 | - Are there **improvements** that could be made to the **code style?** 249 | - Is there **code duplication** in the package that should be reduced? 250 | 251 | ```{r inspect-code} 252 | pkgreviewr::pkgreview_print_source("rdflib") 253 | ``` 254 | **\* might not be suitable for large packages with many exported functions** 255 | 256 | 257 |
258 |
259 | 260 | #### **comments:** 261 | 262 | 263 | 264 | 265 | ## Review test suite: 266 | 267 | ### test coverage 268 | 269 | ```{r pkg_coverage} 270 | covr::package_coverage(pkg_dir) 271 | 272 | ``` 273 | 274 | ### inspect [tests](https://github.com/cboettig/rdflib/blob/master/tests/testthat) 275 | 276 | 277 | #### **comments:** 278 | 279 | 280 | 281 | 282 | *** 283 | -------------------------------------------------------------------------------- /R/pkgreview.R: -------------------------------------------------------------------------------- 1 | #' Create a review project. 2 | #' 3 | #' Create and initialise an rOpenSci package review project 4 | #' 5 | #' @param pkg_repo character string of the repo owner and name in the form of 6 | #' `"owner/repo"`. 7 | #' @param review_parent directory in which to setup review project and source package 8 | #' source code. 9 | #' @param template character string, one of `review` or `editor`. 10 | #' @param issue_no integer. Issue number of the pkg review in the rOpenSci [`software-review` repository](https://github.com/ropensci/software-review/issues). 11 | #' If `NULL` (default), the issue number is extracted from the rOpenSci **Under Review** badge on the pkg repository README. 12 | #' Supplying an integer to `issue_no` overrides this behaviour and can be useful if a badge has not been added to the README yet. 13 | #' 14 | #' @return setup review project with templates 15 | #' @export 16 | #' 17 | #' @examples 18 | #' \dontrun{ 19 | #' # for a review project 20 | #' pkgreview_create(pkg_repo = "ropensci/rdflib", review_parent = "~/Documents/reviews/") 21 | #' # for editors checks 22 | #' pkgreview_create(pkg_repo = "ropensci/rdflib", review_parent = "~/Documents/editorials/", 23 | #' template = "editor") 24 | #' } 25 | pkgreview_create <- function(pkg_repo, review_parent = ".", 26 | template = c("review", "editor"), 27 | issue_no = NULL) { 28 | template <- match.arg(template) 29 | # checks 30 | review_parent <- fs::path_real(review_parent) 31 | check_rstudio() 32 | check_global_git() 33 | 34 | # get repo metadata 35 | meta <- get_repo_meta(pkg_repo) 36 | tmp <- file.path(tempdir(), "pkgreviewr_prep") 37 | on.exit(unlink(tmp, recursive = T)) 38 | dir.create(tmp, showWarnings = F) 39 | 40 | tmp_pkg_dir <- fs::path(tmp, meta$name) 41 | pkg_dir <- fs::path(review_parent, meta$name) 42 | tmp_review_dir <- fs::path(tmp, glue::glue("{meta$name}-{template}")) 43 | review_dir <- fs::path(review_parent, glue::glue("{meta$name}-{template}")) 44 | 45 | # clone package source code directory and write to review_parent 46 | clone <- clone_pkg(pkg_repo, pkg_dir = tmp_pkg_dir) 47 | if(clone){ 48 | write_dir(tmp_dir = tmp_pkg_dir, out_dir = pkg_dir) 49 | } 50 | 51 | # create project 52 | withr::local_options(list(usethis.quiet = TRUE)) 53 | usethis::create_project(tmp_review_dir, open = FALSE) 54 | unlink(file.path(tmp_review_dir,"R"), recursive = TRUE) 55 | 56 | # initialise and copy review project to review_parent 57 | if(clone){ 58 | pkgreview_init(pkg_repo, review_dir = tmp_review_dir, 59 | pkg_dir = pkg_dir, 60 | template = template, 61 | issue_no = issue_no) 62 | }else{ 63 | todo("Template initialisation of review project", 64 | value(basename(review_dir)) ,"not possible. \n Use: ", 65 | code(" pkgreview_init() "), "after you've cloned repo ", 66 | value(pkg_repo)) 67 | } 68 | # initialise with git 69 | use_git_pkgrv(path = tmp_review_dir) 70 | # write out review dir 71 | write_dir(tmp_dir = tmp_review_dir, out_dir = review_dir) 72 | 73 | if (interactive() & rstudioapi::isAvailable()) rstudioapi::openProject(review_dir, 74 | newSession = T) 75 | } 76 | 77 | 78 | 79 | 80 | #' Initialise pkgreview 81 | #' 82 | #' @inheritParams pkgreview_create 83 | #' @param review_dir path to the review directory. Defaults to the working directory. 84 | #' @param pkg_dir path to package source directory, cloned from github. Defaults 85 | #' to the package source code directory in the review parent. 86 | #' 87 | #' @return Initialisation creates pre-populated `index.Rmd`, `pkgreview.md` and `README.md` documents. 88 | #' To initialise correctly, the function requires that the source code for the 89 | #' package has been cloned. This might need to be done manually if it failed 90 | #' during review creation. If setup is correct. 91 | #' @export 92 | #' 93 | #' @examples 94 | #' \dontrun{ 95 | #' # run from within an uninitialised pkgreviewr project 96 | #' pkgreview_init(pkg_repo = "ropensci/rdflib") 97 | #' } 98 | pkgreview_init <- function(pkg_repo, review_dir = ".", 99 | pkg_dir = NULL, 100 | template = c("review", "editor"), 101 | issue_no = NULL){ 102 | 103 | template <- match.arg(template) 104 | 105 | # get repo metadata 106 | meta <- get_repo_meta(pkg_repo) 107 | 108 | # get package metadata 109 | if(is.null(pkg_dir)){ 110 | pkg_dir <- fs::path(fs::path_dir(review_dir), meta$name)} 111 | 112 | assertthat::assert_that(assertthat::is.dir(pkg_dir)) 113 | assertthat::assert_that(file.exists(file.path(pkg_dir, "DESCRIPTION"))) 114 | pkg_data <- pkgreview_getdata(pkg_dir = pkg_dir, pkg_repo, 115 | template = template, 116 | issue_no = issue_no) 117 | 118 | usethis::with_project(review_dir, { 119 | # create templates 120 | use_onboarding_tmpl(template) 121 | pkgreview_index_rmd(pkg_data, template) 122 | switch (template, 123 | "review" = pkgreview_readme_md(pkg_data), 124 | "editor" = pkgreview_request(pkg_data) 125 | ) 126 | }, quiet = TRUE) 127 | 128 | done(template, " project ", value(basename(review_dir)), 129 | " initialised successfully") 130 | } 131 | 132 | #' pkgreview_getdata 133 | #' 134 | #' get package metadata from package source code. 135 | #' @inheritParams pkgreview_create 136 | #' @inheritParams pkgreview_init 137 | #' 138 | #' @return a list of package metadata 139 | # @importFrom usethis getFromNamespace project_data 140 | #' @examples 141 | #' \dontrun{ 142 | #' # run from within a pkgreviewr project with the package source code in a 143 | #' sibling directory 144 | #' pkgreview_getdata("../rdflib") 145 | #' } 146 | pkgreview_getdata <- function(pkg_dir = NULL, pkg_repo, 147 | template = c("review", "editor"), 148 | issue_no = NULL) { 149 | 150 | template <- match.arg(template) 151 | 152 | # get repo metadata 153 | meta <- get_repo_meta(pkg_repo, full = T) 154 | if(is.null(pkg_dir)){ 155 | pkg_dir <- fs::path(usethis::proj_path(".."), meta$name)} 156 | 157 | # package repo data 158 | pkg_data <- usethis:::package_data(pkg_dir) 159 | 160 | pkg_data$URL <- meta$html_url 161 | 162 | pkg_data$pkg_dir <- pkg_dir 163 | pkg_data$Rmd <- FALSE 164 | pkg_data$pkg_repo <- pkg_repo 165 | pkg_data$username <- meta$owner$login 166 | pkg_data$repo <- meta$name 167 | 168 | # reviewer data 169 | whoami_try <- try(gh::gh_whoami(usethis::github_token())) 170 | if(!inherits(whoami_try, "try-error")){ 171 | pkg_data$whoami <- whoami_try$login 172 | pkg_data$whoami_url <- whoami_try$html_url 173 | pkg_data$review_repo <- glue::glue("{pkg_data$whoami}/{pkg_data$repo}-{template}") 174 | pkg_data$index_url <- glue::glue("https://{pkg_data$whoami}.github.io/{pkg_data$repo}-{template}/index.nb.html") 175 | pkg_data$pkgreview_url <- glue::glue("https://github.com/{pkg_data$review_repo}/blob/master/pkgreview.md") 176 | }else{ 177 | warning("GitHub user unidentifed. 178 | URLs related to review and review repository not initialised.") 179 | pkg_data$whoami <- NULL 180 | pkg_data$whoami_url <- NULL 181 | pkg_data$review_repo <- NULL 182 | pkg_data$index_url <- NULL 183 | pkg_data$pkgreview_url <- NULL 184 | } 185 | 186 | pkg_data$issue_url <- ifelse(is.null(issue_no), 187 | issue_meta(pkg_data$pkg_repo, parameter = "url"), 188 | paste0("https://github.com/ropensci/software-review/issues/", issue_no)) 189 | pkg_data$number <- ifelse(is.null(issue_no), 190 | issue_meta(pkg_data$pkg_repo), 191 | issue_no) 192 | pkg_data$site <- meta$homepage 193 | 194 | pkg_data 195 | } 196 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | GNU General Public License 2 | ========================== 3 | 4 | _Version 3, 29 June 2007_ 5 | _Copyright © 2007 Free Software Foundation, Inc. <>_ 6 | 7 | Everyone is permitted to copy and distribute verbatim copies of this license 8 | document, but changing it is not allowed. 9 | 10 | ## Preamble 11 | 12 | The GNU General Public License is a free, copyleft license for software and other 13 | kinds of works. 14 | 15 | The licenses for most software and other practical works are designed to take away 16 | your freedom to share and change the works. By contrast, the GNU General Public 17 | License is intended to guarantee your freedom to share and change all versions of a 18 | program--to make sure it remains free software for all its users. We, the Free 19 | Software Foundation, use the GNU General Public License for most of our software; it 20 | applies also to any other work released this way by its authors. You can apply it to 21 | your programs, too. 22 | 23 | When we speak of free software, we are referring to freedom, not price. Our General 24 | Public Licenses are designed to make sure that you have the freedom to distribute 25 | copies of free software (and charge for them if you wish), that you receive source 26 | code or can get it if you want it, that you can change the software or use pieces of 27 | it in new free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you these rights or 30 | asking you to surrender the rights. Therefore, you have certain responsibilities if 31 | you distribute copies of the software, or if you modify it: responsibilities to 32 | respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether gratis or for a fee, 35 | you must pass on to the recipients the same freedoms that you received. You must make 36 | sure that they, too, receive or can get the source code. And you must show them these 37 | terms so they know their rights. 38 | 39 | Developers that use the GNU GPL protect your rights with two steps: **(1)** assert 40 | copyright on the software, and **(2)** offer you this License giving you legal permission 41 | to copy, distribute and/or modify it. 42 | 43 | For the developers' and authors' protection, the GPL clearly explains that there is 44 | no warranty for this free software. For both users' and authors' sake, the GPL 45 | requires that modified versions be marked as changed, so that their problems will not 46 | be attributed erroneously to authors of previous versions. 47 | 48 | Some devices are designed to deny users access to install or run modified versions of 49 | the software inside them, although the manufacturer can do so. This is fundamentally 50 | incompatible with the aim of protecting users' freedom to change the software. The 51 | systematic pattern of such abuse occurs in the area of products for individuals to 52 | use, which is precisely where it is most unacceptable. Therefore, we have designed 53 | this version of the GPL to prohibit the practice for those products. If such problems 54 | arise substantially in other domains, we stand ready to extend this provision to 55 | those domains in future versions of the GPL, as needed to protect the freedom of 56 | users. 57 | 58 | Finally, every program is threatened constantly by software patents. States should 59 | not allow patents to restrict development and use of software on general-purpose 60 | computers, but in those that do, we wish to avoid the special danger that patents 61 | applied to a free program could make it effectively proprietary. To prevent this, the 62 | GPL assures that patents cannot be used to render the program non-free. 63 | 64 | The precise terms and conditions for copying, distribution and modification follow. 65 | 66 | ## TERMS AND CONDITIONS 67 | 68 | ### 0. Definitions 69 | 70 | “This License” refers to version 3 of the GNU General Public License. 71 | 72 | “Copyright” also means copyright-like laws that apply to other kinds of 73 | works, such as semiconductor masks. 74 | 75 | “The Program” refers to any copyrightable work licensed under this 76 | License. Each licensee is addressed as “you”. “Licensees” and 77 | “recipients” may be individuals or organizations. 78 | 79 | To “modify” a work means to copy from or adapt all or part of the work in 80 | a fashion requiring copyright permission, other than the making of an exact copy. The 81 | resulting work is called a “modified version” of the earlier work or a 82 | work “based on” the earlier work. 83 | 84 | A “covered work” means either the unmodified Program or a work based on 85 | the Program. 86 | 87 | To “propagate” a work means to do anything with it that, without 88 | permission, would make you directly or secondarily liable for infringement under 89 | applicable copyright law, except executing it on a computer or modifying a private 90 | copy. Propagation includes copying, distribution (with or without modification), 91 | making available to the public, and in some countries other activities as well. 92 | 93 | To “convey” a work means any kind of propagation that enables other 94 | parties to make or receive copies. Mere interaction with a user through a computer 95 | network, with no transfer of a copy, is not conveying. 96 | 97 | An interactive user interface displays “Appropriate Legal Notices” to the 98 | extent that it includes a convenient and prominently visible feature that **(1)** 99 | displays an appropriate copyright notice, and **(2)** tells the user that there is no 100 | warranty for the work (except to the extent that warranties are provided), that 101 | licensees may convey the work under this License, and how to view a copy of this 102 | License. If the interface presents a list of user commands or options, such as a 103 | menu, a prominent item in the list meets this criterion. 104 | 105 | ### 1. Source Code 106 | 107 | The “source code” for a work means the preferred form of the work for 108 | making modifications to it. “Object code” means any non-source form of a 109 | work. 110 | 111 | A “Standard Interface” means an interface that either is an official 112 | standard defined by a recognized standards body, or, in the case of interfaces 113 | specified for a particular programming language, one that is widely used among 114 | developers working in that language. 115 | 116 | The “System Libraries” of an executable work include anything, other than 117 | the work as a whole, that **(a)** is included in the normal form of packaging a Major 118 | Component, but which is not part of that Major Component, and **(b)** serves only to 119 | enable use of the work with that Major Component, or to implement a Standard 120 | Interface for which an implementation is available to the public in source code form. 121 | A “Major Component”, in this context, means a major essential component 122 | (kernel, window system, and so on) of the specific operating system (if any) on which 123 | the executable work runs, or a compiler used to produce the work, or an object code 124 | interpreter used to run it. 125 | 126 | The “Corresponding Source” for a work in object code form means all the 127 | source code needed to generate, install, and (for an executable work) run the object 128 | code and to modify the work, including scripts to control those activities. However, 129 | it does not include the work's System Libraries, or general-purpose tools or 130 | generally available free programs which are used unmodified in performing those 131 | activities but which are not part of the work. For example, Corresponding Source 132 | includes interface definition files associated with source files for the work, and 133 | the source code for shared libraries and dynamically linked subprograms that the work 134 | is specifically designed to require, such as by intimate data communication or 135 | control flow between those subprograms and other parts of the work. 136 | 137 | The Corresponding Source need not include anything that users can regenerate 138 | automatically from other parts of the Corresponding Source. 139 | 140 | The Corresponding Source for a work in source code form is that same work. 141 | 142 | ### 2. Basic Permissions 143 | 144 | All rights granted under this License are granted for the term of copyright on the 145 | Program, and are irrevocable provided the stated conditions are met. This License 146 | explicitly affirms your unlimited permission to run the unmodified Program. The 147 | output from running a covered work is covered by this License only if the output, 148 | given its content, constitutes a covered work. This License acknowledges your rights 149 | of fair use or other equivalent, as provided by copyright law. 150 | 151 | You may make, run and propagate covered works that you do not convey, without 152 | conditions so long as your license otherwise remains in force. You may convey covered 153 | works to others for the sole purpose of having them make modifications exclusively 154 | for you, or provide you with facilities for running those works, provided that you 155 | comply with the terms of this License in conveying all material for which you do not 156 | control copyright. Those thus making or running the covered works for you must do so 157 | exclusively on your behalf, under your direction and control, on terms that prohibit 158 | them from making any copies of your copyrighted material outside their relationship 159 | with you. 160 | 161 | Conveying under any other circumstances is permitted solely under the conditions 162 | stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 163 | 164 | ### 3. Protecting Users' Legal Rights From Anti-Circumvention Law 165 | 166 | No covered work shall be deemed part of an effective technological measure under any 167 | applicable law fulfilling obligations under article 11 of the WIPO copyright treaty 168 | adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention 169 | of such measures. 170 | 171 | When you convey a covered work, you waive any legal power to forbid circumvention of 172 | technological measures to the extent such circumvention is effected by exercising 173 | rights under this License with respect to the covered work, and you disclaim any 174 | intention to limit operation or modification of the work as a means of enforcing, 175 | against the work's users, your or third parties' legal rights to forbid circumvention 176 | of technological measures. 177 | 178 | ### 4. Conveying Verbatim Copies 179 | 180 | You may convey verbatim copies of the Program's source code as you receive it, in any 181 | medium, provided that you conspicuously and appropriately publish on each copy an 182 | appropriate copyright notice; keep intact all notices stating that this License and 183 | any non-permissive terms added in accord with section 7 apply to the code; keep 184 | intact all notices of the absence of any warranty; and give all recipients a copy of 185 | this License along with the Program. 186 | 187 | You may charge any price or no price for each copy that you convey, and you may offer 188 | support or warranty protection for a fee. 189 | 190 | ### 5. Conveying Modified Source Versions 191 | 192 | You may convey a work based on the Program, or the modifications to produce it from 193 | the Program, in the form of source code under the terms of section 4, provided that 194 | you also meet all of these conditions: 195 | 196 | * **a)** The work must carry prominent notices stating that you modified it, and giving a 197 | relevant date. 198 | * **b)** The work must carry prominent notices stating that it is released under this 199 | License and any conditions added under section 7. This requirement modifies the 200 | requirement in section 4 to “keep intact all notices”. 201 | * **c)** You must license the entire work, as a whole, under this License to anyone who 202 | comes into possession of a copy. This License will therefore apply, along with any 203 | applicable section 7 additional terms, to the whole of the work, and all its parts, 204 | regardless of how they are packaged. This License gives no permission to license the 205 | work in any other way, but it does not invalidate such permission if you have 206 | separately received it. 207 | * **d)** If the work has interactive user interfaces, each must display Appropriate Legal 208 | Notices; however, if the Program has interactive interfaces that do not display 209 | Appropriate Legal Notices, your work need not make them do so. 210 | 211 | A compilation of a covered work with other separate and independent works, which are 212 | not by their nature extensions of the covered work, and which are not combined with 213 | it such as to form a larger program, in or on a volume of a storage or distribution 214 | medium, is called an “aggregate” if the compilation and its resulting 215 | copyright are not used to limit the access or legal rights of the compilation's users 216 | beyond what the individual works permit. Inclusion of a covered work in an aggregate 217 | does not cause this License to apply to the other parts of the aggregate. 218 | 219 | ### 6. Conveying Non-Source Forms 220 | 221 | You may convey a covered work in object code form under the terms of sections 4 and 222 | 5, provided that you also convey the machine-readable Corresponding Source under the 223 | terms of this License, in one of these ways: 224 | 225 | * **a)** Convey the object code in, or embodied in, a physical product (including a 226 | physical distribution medium), accompanied by the Corresponding Source fixed on a 227 | durable physical medium customarily used for software interchange. 228 | * **b)** Convey the object code in, or embodied in, a physical product (including a 229 | physical distribution medium), accompanied by a written offer, valid for at least 230 | three years and valid for as long as you offer spare parts or customer support for 231 | that product model, to give anyone who possesses the object code either **(1)** a copy of 232 | the Corresponding Source for all the software in the product that is covered by this 233 | License, on a durable physical medium customarily used for software interchange, for 234 | a price no more than your reasonable cost of physically performing this conveying of 235 | source, or **(2)** access to copy the Corresponding Source from a network server at no 236 | charge. 237 | * **c)** Convey individual copies of the object code with a copy of the written offer to 238 | provide the Corresponding Source. This alternative is allowed only occasionally and 239 | noncommercially, and only if you received the object code with such an offer, in 240 | accord with subsection 6b. 241 | * **d)** Convey the object code by offering access from a designated place (gratis or for 242 | a charge), and offer equivalent access to the Corresponding Source in the same way 243 | through the same place at no further charge. You need not require recipients to copy 244 | the Corresponding Source along with the object code. If the place to copy the object 245 | code is a network server, the Corresponding Source may be on a different server 246 | (operated by you or a third party) that supports equivalent copying facilities, 247 | provided you maintain clear directions next to the object code saying where to find 248 | the Corresponding Source. Regardless of what server hosts the Corresponding Source, 249 | you remain obligated to ensure that it is available for as long as needed to satisfy 250 | these requirements. 251 | * **e)** Convey the object code using peer-to-peer transmission, provided you inform 252 | other peers where the object code and Corresponding Source of the work are being 253 | offered to the general public at no charge under subsection 6d. 254 | 255 | A separable portion of the object code, whose source code is excluded from the 256 | Corresponding Source as a System Library, need not be included in conveying the 257 | object code work. 258 | 259 | A “User Product” is either **(1)** a “consumer product”, which 260 | means any tangible personal property which is normally used for personal, family, or 261 | household purposes, or **(2)** anything designed or sold for incorporation into a 262 | dwelling. In determining whether a product is a consumer product, doubtful cases 263 | shall be resolved in favor of coverage. For a particular product received by a 264 | particular user, “normally used” refers to a typical or common use of 265 | that class of product, regardless of the status of the particular user or of the way 266 | in which the particular user actually uses, or expects or is expected to use, the 267 | product. A product is a consumer product regardless of whether the product has 268 | substantial commercial, industrial or non-consumer uses, unless such uses represent 269 | the only significant mode of use of the product. 270 | 271 | “Installation Information” for a User Product means any methods, 272 | procedures, authorization keys, or other information required to install and execute 273 | modified versions of a covered work in that User Product from a modified version of 274 | its Corresponding Source. The information must suffice to ensure that the continued 275 | functioning of the modified object code is in no case prevented or interfered with 276 | solely because modification has been made. 277 | 278 | If you convey an object code work under this section in, or with, or specifically for 279 | use in, a User Product, and the conveying occurs as part of a transaction in which 280 | the right of possession and use of the User Product is transferred to the recipient 281 | in perpetuity or for a fixed term (regardless of how the transaction is 282 | characterized), the Corresponding Source conveyed under this section must be 283 | accompanied by the Installation Information. But this requirement does not apply if 284 | neither you nor any third party retains the ability to install modified object code 285 | on the User Product (for example, the work has been installed in ROM). 286 | 287 | The requirement to provide Installation Information does not include a requirement to 288 | continue to provide support service, warranty, or updates for a work that has been 289 | modified or installed by the recipient, or for the User Product in which it has been 290 | modified or installed. Access to a network may be denied when the modification itself 291 | materially and adversely affects the operation of the network or violates the rules 292 | and protocols for communication across the network. 293 | 294 | Corresponding Source conveyed, and Installation Information provided, in accord with 295 | this section must be in a format that is publicly documented (and with an 296 | implementation available to the public in source code form), and must require no 297 | special password or key for unpacking, reading or copying. 298 | 299 | ### 7. Additional Terms 300 | 301 | “Additional permissions” are terms that supplement the terms of this 302 | License by making exceptions from one or more of its conditions. Additional 303 | permissions that are applicable to the entire Program shall be treated as though they 304 | were included in this License, to the extent that they are valid under applicable 305 | law. If additional permissions apply only to part of the Program, that part may be 306 | used separately under those permissions, but the entire Program remains governed by 307 | this License without regard to the additional permissions. 308 | 309 | When you convey a copy of a covered work, you may at your option remove any 310 | additional permissions from that copy, or from any part of it. (Additional 311 | permissions may be written to require their own removal in certain cases when you 312 | modify the work.) You may place additional permissions on material, added by you to a 313 | covered work, for which you have or can give appropriate copyright permission. 314 | 315 | Notwithstanding any other provision of this License, for material you add to a 316 | covered work, you may (if authorized by the copyright holders of that material) 317 | supplement the terms of this License with terms: 318 | 319 | * **a)** Disclaiming warranty or limiting liability differently from the terms of 320 | sections 15 and 16 of this License; or 321 | * **b)** Requiring preservation of specified reasonable legal notices or author 322 | attributions in that material or in the Appropriate Legal Notices displayed by works 323 | containing it; or 324 | * **c)** Prohibiting misrepresentation of the origin of that material, or requiring that 325 | modified versions of such material be marked in reasonable ways as different from the 326 | original version; or 327 | * **d)** Limiting the use for publicity purposes of names of licensors or authors of the 328 | material; or 329 | * **e)** Declining to grant rights under trademark law for use of some trade names, 330 | trademarks, or service marks; or 331 | * **f)** Requiring indemnification of licensors and authors of that material by anyone 332 | who conveys the material (or modified versions of it) with contractual assumptions of 333 | liability to the recipient, for any liability that these contractual assumptions 334 | directly impose on those licensors and authors. 335 | 336 | All other non-permissive additional terms are considered “further 337 | restrictions” within the meaning of section 10. If the Program as you received 338 | it, or any part of it, contains a notice stating that it is governed by this License 339 | along with a term that is a further restriction, you may remove that term. If a 340 | license document contains a further restriction but permits relicensing or conveying 341 | under this License, you may add to a covered work material governed by the terms of 342 | that license document, provided that the further restriction does not survive such 343 | relicensing or conveying. 344 | 345 | If you add terms to a covered work in accord with this section, you must place, in 346 | the relevant source files, a statement of the additional terms that apply to those 347 | files, or a notice indicating where to find the applicable terms. 348 | 349 | Additional terms, permissive or non-permissive, may be stated in the form of a 350 | separately written license, or stated as exceptions; the above requirements apply 351 | either way. 352 | 353 | ### 8. Termination 354 | 355 | You may not propagate or modify a covered work except as expressly provided under 356 | this License. Any attempt otherwise to propagate or modify it is void, and will 357 | automatically terminate your rights under this License (including any patent licenses 358 | granted under the third paragraph of section 11). 359 | 360 | However, if you cease all violation of this License, then your license from a 361 | particular copyright holder is reinstated **(a)** provisionally, unless and until the 362 | copyright holder explicitly and finally terminates your license, and **(b)** permanently, 363 | if the copyright holder fails to notify you of the violation by some reasonable means 364 | prior to 60 days after the cessation. 365 | 366 | Moreover, your license from a particular copyright holder is reinstated permanently 367 | if the copyright holder notifies you of the violation by some reasonable means, this 368 | is the first time you have received notice of violation of this License (for any 369 | work) from that copyright holder, and you cure the violation prior to 30 days after 370 | your receipt of the notice. 371 | 372 | Termination of your rights under this section does not terminate the licenses of 373 | parties who have received copies or rights from you under this License. If your 374 | rights have been terminated and not permanently reinstated, you do not qualify to 375 | receive new licenses for the same material under section 10. 376 | 377 | ### 9. Acceptance Not Required for Having Copies 378 | 379 | You are not required to accept this License in order to receive or run a copy of the 380 | Program. Ancillary propagation of a covered work occurring solely as a consequence of 381 | using peer-to-peer transmission to receive a copy likewise does not require 382 | acceptance. However, nothing other than this License grants you permission to 383 | propagate or modify any covered work. These actions infringe copyright if you do not 384 | accept this License. Therefore, by modifying or propagating a covered work, you 385 | indicate your acceptance of this License to do so. 386 | 387 | ### 10. Automatic Licensing of Downstream Recipients 388 | 389 | Each time you convey a covered work, the recipient automatically receives a license 390 | from the original licensors, to run, modify and propagate that work, subject to this 391 | License. You are not responsible for enforcing compliance by third parties with this 392 | License. 393 | 394 | An “entity transaction” is a transaction transferring control of an 395 | organization, or substantially all assets of one, or subdividing an organization, or 396 | merging organizations. If propagation of a covered work results from an entity 397 | transaction, each party to that transaction who receives a copy of the work also 398 | receives whatever licenses to the work the party's predecessor in interest had or 399 | could give under the previous paragraph, plus a right to possession of the 400 | Corresponding Source of the work from the predecessor in interest, if the predecessor 401 | has it or can get it with reasonable efforts. 402 | 403 | You may not impose any further restrictions on the exercise of the rights granted or 404 | affirmed under this License. For example, you may not impose a license fee, royalty, 405 | or other charge for exercise of rights granted under this License, and you may not 406 | initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging 407 | that any patent claim is infringed by making, using, selling, offering for sale, or 408 | importing the Program or any portion of it. 409 | 410 | ### 11. Patents 411 | 412 | A “contributor” is a copyright holder who authorizes use under this 413 | License of the Program or a work on which the Program is based. The work thus 414 | licensed is called the contributor's “contributor version”. 415 | 416 | A contributor's “essential patent claims” are all patent claims owned or 417 | controlled by the contributor, whether already acquired or hereafter acquired, that 418 | would be infringed by some manner, permitted by this License, of making, using, or 419 | selling its contributor version, but do not include claims that would be infringed 420 | only as a consequence of further modification of the contributor version. For 421 | purposes of this definition, “control” includes the right to grant patent 422 | sublicenses in a manner consistent with the requirements of this License. 423 | 424 | Each contributor grants you a non-exclusive, worldwide, royalty-free patent license 425 | under the contributor's essential patent claims, to make, use, sell, offer for sale, 426 | import and otherwise run, modify and propagate the contents of its contributor 427 | version. 428 | 429 | In the following three paragraphs, a “patent license” is any express 430 | agreement or commitment, however denominated, not to enforce a patent (such as an 431 | express permission to practice a patent or covenant not to sue for patent 432 | infringement). To “grant” such a patent license to a party means to make 433 | such an agreement or commitment not to enforce a patent against the party. 434 | 435 | If you convey a covered work, knowingly relying on a patent license, and the 436 | Corresponding Source of the work is not available for anyone to copy, free of charge 437 | and under the terms of this License, through a publicly available network server or 438 | other readily accessible means, then you must either **(1)** cause the Corresponding 439 | Source to be so available, or **(2)** arrange to deprive yourself of the benefit of the 440 | patent license for this particular work, or **(3)** arrange, in a manner consistent with 441 | the requirements of this License, to extend the patent license to downstream 442 | recipients. “Knowingly relying” means you have actual knowledge that, but 443 | for the patent license, your conveying the covered work in a country, or your 444 | recipient's use of the covered work in a country, would infringe one or more 445 | identifiable patents in that country that you have reason to believe are valid. 446 | 447 | If, pursuant to or in connection with a single transaction or arrangement, you 448 | convey, or propagate by procuring conveyance of, a covered work, and grant a patent 449 | license to some of the parties receiving the covered work authorizing them to use, 450 | propagate, modify or convey a specific copy of the covered work, then the patent 451 | license you grant is automatically extended to all recipients of the covered work and 452 | works based on it. 453 | 454 | A patent license is “discriminatory” if it does not include within the 455 | scope of its coverage, prohibits the exercise of, or is conditioned on the 456 | non-exercise of one or more of the rights that are specifically granted under this 457 | License. You may not convey a covered work if you are a party to an arrangement with 458 | a third party that is in the business of distributing software, under which you make 459 | payment to the third party based on the extent of your activity of conveying the 460 | work, and under which the third party grants, to any of the parties who would receive 461 | the covered work from you, a discriminatory patent license **(a)** in connection with 462 | copies of the covered work conveyed by you (or copies made from those copies), or **(b)** 463 | primarily for and in connection with specific products or compilations that contain 464 | the covered work, unless you entered into that arrangement, or that patent license 465 | was granted, prior to 28 March 2007. 466 | 467 | Nothing in this License shall be construed as excluding or limiting any implied 468 | license or other defenses to infringement that may otherwise be available to you 469 | under applicable patent law. 470 | 471 | ### 12. No Surrender of Others' Freedom 472 | 473 | If conditions are imposed on you (whether by court order, agreement or otherwise) 474 | that contradict the conditions of this License, they do not excuse you from the 475 | conditions of this License. If you cannot convey a covered work so as to satisfy 476 | simultaneously your obligations under this License and any other pertinent 477 | obligations, then as a consequence you may not convey it at all. For example, if you 478 | agree to terms that obligate you to collect a royalty for further conveying from 479 | those to whom you convey the Program, the only way you could satisfy both those terms 480 | and this License would be to refrain entirely from conveying the Program. 481 | 482 | ### 13. Use with the GNU Affero General Public License 483 | 484 | Notwithstanding any other provision of this License, you have permission to link or 485 | combine any covered work with a work licensed under version 3 of the GNU Affero 486 | General Public License into a single combined work, and to convey the resulting work. 487 | The terms of this License will continue to apply to the part which is the covered 488 | work, but the special requirements of the GNU Affero General Public License, section 489 | 13, concerning interaction through a network will apply to the combination as such. 490 | 491 | ### 14. Revised Versions of this License 492 | 493 | The Free Software Foundation may publish revised and/or new versions of the GNU 494 | General Public License from time to time. Such new versions will be similar in spirit 495 | to the present version, but may differ in detail to address new problems or concerns. 496 | 497 | Each version is given a distinguishing version number. If the Program specifies that 498 | a certain numbered version of the GNU General Public License “or any later 499 | version” applies to it, you have the option of following the terms and 500 | conditions either of that numbered version or of any later version published by the 501 | Free Software Foundation. If the Program does not specify a version number of the GNU 502 | General Public License, you may choose any version ever published by the Free 503 | Software Foundation. 504 | 505 | If the Program specifies that a proxy can decide which future versions of the GNU 506 | General Public License can be used, that proxy's public statement of acceptance of a 507 | version permanently authorizes you to choose that version for the Program. 508 | 509 | Later license versions may give you additional or different permissions. However, no 510 | additional obligations are imposed on any author or copyright holder as a result of 511 | your choosing to follow a later version. 512 | 513 | ### 15. Disclaimer of Warranty 514 | 515 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. 516 | EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 517 | PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER 518 | EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 519 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE 520 | QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE 521 | DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 522 | 523 | ### 16. Limitation of Liability 524 | 525 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY 526 | COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS 527 | PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, 528 | INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE 529 | PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE 530 | OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE 531 | WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 532 | POSSIBILITY OF SUCH DAMAGES. 533 | 534 | ### 17. Interpretation of Sections 15 and 16 535 | 536 | If the disclaimer of warranty and limitation of liability provided above cannot be 537 | given local legal effect according to their terms, reviewing courts shall apply local 538 | law that most closely approximates an absolute waiver of all civil liability in 539 | connection with the Program, unless a warranty or assumption of liability accompanies 540 | a copy of the Program in return for a fee. 541 | 542 | _END OF TERMS AND CONDITIONS_ 543 | 544 | ## How to Apply These Terms to Your New Programs 545 | 546 | If you develop a new program, and you want it to be of the greatest possible use to 547 | the public, the best way to achieve this is to make it free software which everyone 548 | can redistribute and change under these terms. 549 | 550 | To do so, attach the following notices to the program. It is safest to attach them 551 | to the start of each source file to most effectively state the exclusion of warranty; 552 | and each file should have at least the “copyright” line and a pointer to 553 | where the full notice is found. 554 | 555 | 556 | Copyright (C) 2018 Anna Krystalli 557 | 558 | This program is free software: you can redistribute it and/or modify 559 | it under the terms of the GNU General Public License as published by 560 | the Free Software Foundation, either version 3 of the License, or 561 | (at your option) any later version. 562 | 563 | This program is distributed in the hope that it will be useful, 564 | but WITHOUT ANY WARRANTY; without even the implied warranty of 565 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 566 | GNU General Public License for more details. 567 | 568 | You should have received a copy of the GNU General Public License 569 | along with this program. If not, see . 570 | 571 | Also add information on how to contact you by electronic and paper mail. 572 | 573 | If the program does terminal interaction, make it output a short notice like this 574 | when it starts in an interactive mode: 575 | 576 | pkgreviewr Copyright (C) 2018 Anna Krystalli 577 | This program comes with ABSOLUTELY NO WARRANTY; for details type 'show w'. 578 | This is free software, and you are welcome to redistribute it 579 | under certain conditions; type 'show c' for details. 580 | 581 | The hypothetical commands `show w` and `show c` should show the appropriate parts of 582 | the General Public License. Of course, your program's commands might be different; 583 | for a GUI interface, you would use an “about box”. 584 | 585 | You should also get your employer (if you work as a programmer) or school, if any, to 586 | sign a “copyright disclaimer” for the program, if necessary. For more 587 | information on this, and how to apply and follow the GNU GPL, see 588 | <>. 589 | 590 | The GNU General Public License does not permit incorporating your program into 591 | proprietary programs. If your program is a subroutine library, you may consider it 592 | more useful to permit linking proprietary applications with the library. If this is 593 | what you want to do, use the GNU Lesser General Public License instead of this 594 | License. But first, please read 595 | <>. 596 | --------------------------------------------------------------------------------