Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add scripts to lint task view #13

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions _script/download_cran_packages.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
download_tarball <- function(pkgname, version) {

fn <- glue::glue("{pkgname}_{version}.tar.gz")
download.file(
glue::glue("https://cran.r-project.org/src/contrib/{fn}"),
file.path("_packages", fn)
)

}

purrr::walk2(
ctv_pkg_descriptions$Package,
ctv_pkg_descriptions$Version,
download_tarball
)

# Manual work around https://github.com/bernadette-eu/Bernadette/pull/10
file.remove(file.path("_packages", "Bernadette_1.1.4.tar.gz"))
20 changes: 20 additions & 0 deletions _script/lint_packages.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
tf <- tempfile()

# Loop to extract all the tarballs in tf
list.files("_packages", full.names = TRUE) |>
purrr::walk(function(f) {
untar(
tarfile = f,
exdir = tf
)
})

safe_lint <- purrr::safely(lintr::lint_package)
# Loop to lint all extracted packages in tf
res <- list.files(tf, full.names = TRUE) |>
purrr::set_names(basename) |>
purrr::map(function(package) {
safe_lint(
package
)
})
161 changes: 161 additions & 0 deletions renv.lock
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,16 @@
],
"Hash": "ae6cbbe1492f4de79c45fce06f967ce8"
},
"backports": {
"Package": "backports",
"Version": "1.4.1",
"Source": "Repository",
"Repository": "RSPM",
"Requirements": [
"R"
],
"Hash": "c39fbec8a30d23e721980b8afb31984c"
},
"base64enc": {
"Package": "base64enc",
"Version": "0.1-3",
Expand Down Expand Up @@ -91,6 +101,19 @@
],
"Hash": "c35768291560ce302c0a6589f92e837d"
},
"callr": {
"Package": "callr",
"Version": "3.7.3",
"Source": "Repository",
"Repository": "RSPM",
"Requirements": [
"R",
"R6",
"processx",
"utils"
],
"Hash": "9b2191ede20fa29828139b9900922e51"
},
"cli": {
"Package": "cli",
"Version": "3.6.1",
Expand All @@ -102,6 +125,16 @@
],
"Hash": "89e6d8219950eac806ae0c489052048a"
},
"codetools": {
"Package": "codetools",
"Version": "0.2-19",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"R"
],
"Hash": "c089a619a7fae175d149d89164f8c7d8"
},
"commonmark": {
"Package": "commonmark",
"Version": "1.9.0",
Expand Down Expand Up @@ -155,6 +188,34 @@
],
"Hash": "511bacbfa153a15251166b463b4da4f9"
},
"cyclocomp": {
"Package": "cyclocomp",
"Version": "1.1.1",
"Source": "Repository",
"Repository": "RSPM",
"Requirements": [
"callr",
"crayon",
"desc",
"remotes",
"withr"
],
"Hash": "cdc4a473222b0112d4df0bcfbed12d44"
},
"desc": {
"Package": "desc",
"Version": "1.4.2",
"Source": "Repository",
"Repository": "RSPM",
"Requirements": [
"R",
"R6",
"cli",
"rprojroot",
"utils"
],
"Hash": "6b9602c7ebbe87101a9c8edb6e8b6d21"
},
"digest": {
"Package": "digest",
"Version": "0.6.33",
Expand Down Expand Up @@ -408,6 +469,27 @@
],
"Hash": "001cecbeac1cff9301bdc3775ee46a86"
},
"lintr": {
"Package": "lintr",
"Version": "3.1.0",
"Source": "Repository",
"Repository": "RSPM",
"Requirements": [
"R",
"backports",
"codetools",
"cyclocomp",
"digest",
"glue",
"knitr",
"rex",
"stats",
"utils",
"xml2",
"xmlparsedata"
],
"Hash": "2b4b803af6017e93b67ddaf0eacba918"
},
"magrittr": {
"Package": "magrittr",
"Version": "2.0.3",
Expand Down Expand Up @@ -493,6 +575,19 @@
"Repository": "RSPM",
"Hash": "95ef9167b75dde9d2ccc3c7528393e7e"
},
"processx": {
"Package": "processx",
"Version": "3.8.2",
"Source": "Repository",
"Repository": "RSPM",
"Requirements": [
"R",
"R6",
"ps",
"utils"
],
"Hash": "3efbd8ac1be0296a46c55387aeace0f3"
},
"promises": {
"Package": "promises",
"Version": "1.2.1",
Expand All @@ -509,6 +604,17 @@
],
"Hash": "0d8a15c9d000970ada1ab21405387dee"
},
"ps": {
"Package": "ps",
"Version": "1.7.5",
"Source": "Repository",
"Repository": "RSPM",
"Requirements": [
"R",
"utils"
],
"Hash": "709d852d33178db54b17c722e5b1e594"
},
"purrr": {
"Package": "purrr",
"Version": "1.0.2.9000",
Expand Down Expand Up @@ -539,6 +645,20 @@
],
"Hash": "5e3c5dc0b071b21fa128676560dbe94d"
},
"remotes": {
"Package": "remotes",
"Version": "2.4.2.1",
"Source": "Repository",
"Repository": "RSPM",
"Requirements": [
"R",
"methods",
"stats",
"tools",
"utils"
],
"Hash": "63d15047eb239f95160112bcadc4fcb9"
},
"renv": {
"Package": "renv",
"Version": "1.0.0",
Expand All @@ -549,6 +669,16 @@
],
"Hash": "c321cd99d56443dbffd1c9e673c0c1a2"
},
"rex": {
"Package": "rex",
"Version": "1.2.1",
"Source": "Repository",
"Repository": "RSPM",
"Requirements": [
"lazyeval"
],
"Hash": "ae34cd56890607370665bee5bd17812f"
},
"rlang": {
"Package": "rlang",
"Version": "1.1.1",
Expand Down Expand Up @@ -584,6 +714,16 @@
],
"Hash": "3854c37590717c08c32ec8542a2e0a35"
},
"rprojroot": {
"Package": "rprojroot",
"Version": "2.0.3",
"Source": "Repository",
"Repository": "RSPM",
"Requirements": [
"R"
],
"Hash": "1de7ab598047a87bba48434ba35d497d"
},
"sass": {
"Package": "sass",
"Version": "0.4.7",
Expand Down Expand Up @@ -765,6 +905,27 @@
],
"Hash": "be07d23211245fc7d4209f54c4e4ffc8"
},
"xml2": {
"Package": "xml2",
"Version": "1.3.5",
"Source": "Repository",
"Repository": "RSPM",
"Requirements": [
"R",
"methods"
],
"Hash": "6c40e5cfcc6aefd88110666e18c31f40"
},
"xmlparsedata": {
"Package": "xmlparsedata",
"Version": "1.0.5",
"Source": "Repository",
"Repository": "RSPM",
"Requirements": [
"R"
],
"Hash": "45e4bf3c46476896e821fc0a408fb4fc"
},
"xtable": {
"Package": "xtable",
"Version": "1.8-4",
Expand Down