Skip to content

Commit

Permalink
distinguish between truly and potentially obsolete for #44
Browse files Browse the repository at this point in the history
  • Loading branch information
mpadge committed Nov 19, 2021
1 parent 47927c6 commit ad364f7
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 13 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: pkgcheck
Title: rOpenSci Package Checks
Version: 0.0.2.131
Version: 0.0.2.132
Authors@R: c(
person("Mark", "Padgham", , "[email protected]", role = c("aut", "cre"),
comment = c(ORCID = "0000-0003-2172-5265")),
Expand Down
35 changes: 30 additions & 5 deletions R/check-obsolete-pkg-deps.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
#'
#' The list of obsolete packages is
#' \url{https://devguide.ropensci.org/building.html#recommended-scaffolding},
#' defined below.
#' defined below. Some of these are truly obsolete, the use of which raises a
#' red cross in the summary method; while others are only potentially obsolete,
#' thus use of which merely raises a note via a print method.
#'
#' @param checks A 'pkgcheck' object with full \pkg{pkgstats} summary and
#' \pkg{goodpractice} results.
Expand All @@ -13,15 +15,25 @@
#' @noRd
pkgchk_obsolete_pkg_deps <- function (checks) {

obs_pkgs <- c ("RCurl", "rjson", "RJSONIO", "XML")
obs_pkgs <- c (
"RCurl", "rjson", "RJSONIO", "XML", # truly obselete
"sp", "rgdal", "maptools", "rgeos" # potentially obsolete
)

deps <- checks$pkg$dependencies$package
deps <- deps [which (!deps == "NA")]

deps [which (deps %in% obs_pkgs)]
}

output_pkgchk_obsolete_pkg_deps <- function (checks) {
output_pkgchk_obsolete_pkg_deps <- function (checks) { # nolint

# https://github.com/ropensci/software-review-meta/issues/47
potential <- paste0 (c ("sp", "rgdal", "maptools", "rgeos"), collapse = "|")
potential <- grep (potential, checks$checks$obsolete_pkg_deps, value = TRUE)

index <- which (!grepl (paste0 (potential, collapse = "|"), obs_pkg_deps))
obs_pkg_deps <- checks$checks$obsolete_pkg_deps [index]

out <- list (
check_pass = length (checks$checks$obsolete_pkg_deps) == 0L,
Expand All @@ -32,8 +44,21 @@ output_pkgchk_obsolete_pkg_deps <- function (checks) {
if (!out$check_pass) {
out$summary <- paste0 (
"Package depends on the following obsolete packages: [",
paste0 (checks$checks$obsolete_pkg_deps, collapse = ","),
"]"
paste0 (obs_pkg_deps, collapse = ","), "]"
)
}

if (length (potential) > 0L) {

out$print <- paste0 (
"Package contains the following (potentially) ",
"obsolete packages:\n",
paste0 ("- ", potential),
"",
"See our [Recommended Scaffolding](",
"https://devguide.ropensci.org/",
"building.html?q=scaffol#recommended-scaffolding)",
" for alternatives."
)
}

Expand Down
10 changes: 3 additions & 7 deletions codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"codeRepository": "https://github.com/ropensci-review-tools/pkgcheck",
"issueTracker": "https://github.com/ropensci-review-tools/pkgcheck/issues",
"license": "https://spdx.org/licenses/GPL-3.0",
"version": "0.0.2.131",
"version": "0.0.2.132",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "R",
Expand Down Expand Up @@ -311,13 +311,9 @@
"sameAs": "https://CRAN.R-project.org/package=visNetwork"
}
],
"fileSize": "1909.128KB",
"fileSize": "1910.504KB",
"developmentStatus": "https://www.repostatus.org/#concept",
"contIntegration": [
"https://github.com/ropensci-review-tools/pkgcheck/actions?query=workflow%3AR-CMD-check",
"https://github.com/ropensci-review-tools/pkgcheck/actions?query=workflow%3Apush-to-gitlab",
"https://codecov.io/gh/ropensci-review-tools/pkgcheck"
],
"contIntegration": ["https://github.com/ropensci-review-tools/pkgcheck/actions?query=workflow%3AR-CMD-check", "https://github.com/ropensci-review-tools/pkgcheck/actions?query=workflow%3Apush-to-gitlab", "https://codecov.io/gh/ropensci-review-tools/pkgcheck"],
"relatedLink": "https://docs.ropensci.org/pkgcheck/",
"readme": "https://github.com/ropensci-review-tools/pkgcheck/blob/main/README.md"
}

0 comments on commit ad364f7

Please sign in to comment.