Skip to content

Commit

Permalink
Merge pull request #109 from inbo/0.3.4
Browse files Browse the repository at this point in the history
0.3.4
  • Loading branch information
ThierryO authored Jun 21, 2023
2 parents 2879d74 + 2474a29 commit cef05b1
Show file tree
Hide file tree
Showing 14 changed files with 132 additions and 125 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Get tag message
run: |
TAG=$(git tag --contains $(git rev-parse HEAD))
TAG_BODY=$(git tag --contains {{ github.sha }} -n100 | awk '(NR>1)')
TAG_BODY=$(git tag --contains $(git rev-parse HEAD) -n100 | awk '(NR>2)')
echo "TAG=$TAG" >> $GITHUB_OUTPUT
echo "TAG_BODY=$TAG_BODY" >> $GITHUB_OUTPUT
id: tag-body
Expand Down
2 changes: 1 addition & 1 deletion .zenodo.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"title": "checklist: A Thorough and Strict Set of Checks for R Packages and Source Code",
"version": "0.3.3",
"version": "0.3.4",
"license": "GPL-3.0",
"upload_type": "software",
"description": "<p>An opinionated set of rules for R packages and R source code\nprojects.<\/p>",
Expand Down
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ identifiers:
value: 10.5281/zenodo.4028303
- type: url
value: https://inbo.github.io/checklist/
version: 0.3.3
version: 0.3.4
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: checklist
Title: A Thorough and Strict Set of Checks for R Packages and Source Code
Version: 0.3.3
Version: 0.3.4
Authors@R: c(
person("Thierry", "Onkelinx", , "[email protected]", role = c("aut", "cre"),
comment = c(ORCID = "0000-0001-8804-4216", affiliation = "Research Institute for Nature and Forest (INBO)")),
Expand Down
189 changes: 90 additions & 99 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,132 +23,90 @@ RUN apt-get update \

COPY docker/.Rprofile $R_HOME/etc/Rprofile.site

## install INLA
RUN Rscript --no-save --no-restore -e 'remotes::install_cran("INLA", type = "source")'

## install assertthat
RUN apt update \
&& apt install -y --no-install-recommends r-cran-assertthat \
&& Rscript --no-save --no-restore -e 'remotes::install_cran("assertthat")'

## install codemetar
RUN apt update \
&& apt install -y --no-install-recommends r-cran-bookdown \
&& Rscript --no-save --no-restore -e 'remotes::install_cran("bookdown")'

## install codemetar
RUN Rscript --no-save --no-restore -e 'remotes::install_cran("codemetar")'

## install covr
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libharfbuzz-dev \
libfribidi-dev \
r-cran-covr \
&& apt-get clean \
&& Rscript --no-save --no-restore -e 'remotes::install_cran("covr")'

## install curl
RUN apt update \
&& apt install -y --no-install-recommends r-cran-curl \
&& Rscript --no-save --no-restore -e 'remotes::install_cran("curl")'

## install desc
RUN apt update \
&& apt install -y --no-install-recommends r-cran-desc \
&& Rscript --no-save --no-restore -e 'remotes::install_cran("desc")'

## install devtools
RUN apt update \
&& apt install -y --no-install-recommends r-cran-devtools \
&& Rscript --no-save --no-restore -e 'remotes::install_cran("devtools")'

## install fs
RUN apt update \
&& apt install -y --no-install-recommends r-cran-fs \
&& Rscript --no-save --no-restore -e 'remotes::install_cran("fs")'

## install gert
## install jsonlite
RUN apt update \
&& apt install -y --no-install-recommends r-cran-gert \
&& Rscript --no-save --no-restore -e 'remotes::install_cran("gert")'
&& apt install -y --no-install-recommends r-cran-jsonlite \
&& Rscript --no-save --no-restore -e 'remotes::install_cran("jsonlite")'

## install hexSticker
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libmagick++-dev \
&& apt-get clean \
&& Rscript --no-save --no-restore -e 'remotes::install_cran("hexSticker")'
## install hunspell
RUN apt update \
&& apt install -y --no-install-recommends r-cran-hunspell \
&& Rscript --no-save --no-restore -e 'remotes::install_cran("hunspell")'

## install R6
RUN apt update \
&& apt install -y --no-install-recommends r-cran-r6 \
&& Rscript --no-save --no-restore -e 'remotes::install_cran("R6")'

## install httr
RUN apt update \
&& apt install -y --no-install-recommends r-cran-httr \
&& Rscript --no-save --no-restore -e 'remotes::install_cran("httr")'

## install hunspell
RUN apt update \
&& apt install -y --no-install-recommends r-cran-hunspell \
&& Rscript --no-save --no-restore -e 'remotes::install_cran("hunspell")'

## install jsonlite
## install gert
RUN apt update \
&& apt install -y --no-install-recommends r-cran-jsonlite \
&& Rscript --no-save --no-restore -e 'remotes::install_cran("jsonlite")'
&& apt install -y --no-install-recommends r-cran-gert \
&& Rscript --no-save --no-restore -e 'remotes::install_cran("gert")'

## install knitr
RUN apt update \
&& apt install -y --no-install-recommends r-cran-knitr \
&& Rscript --no-save --no-restore -e 'remotes::install_cran("knitr")'

## install lintr
RUN Rscript --no-save --no-restore -e 'remotes::install_cran("lintr")'

## install microbenchmark
RUN Rscript --no-save --no-restore -e 'remotes::install_cran("microbenchmark")'

## install mockery
## install sessioninfo
RUN apt update \
&& apt install -y --no-install-recommends r-cran-mockery \
&& Rscript --no-save --no-restore -e 'remotes::install_cran("mockery")'

## install pdftools
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libpoppler-cpp-dev \
r-cran-pdftools \
&& Rscript --no-save --no-restore -e 'remotes::install_cran("pdftools")'
&& apt install -y --no-install-recommends r-cran-sessioninfo \
&& Rscript --no-save --no-restore -e 'remotes::install_cran("sessioninfo")'

## install pkgdown
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libfontconfig1-dev \
libfreetype6-dev \
libjpeg-dev \
libpng-dev \
libtiff5-dev \
&& Rscript --no-save --no-restore -e 'remotes::install_cran("pkgdown")'
## install withr
RUN apt update \
&& apt install -y --no-install-recommends r-cran-withr \
&& Rscript --no-save --no-restore -e 'remotes::install_cran("withr")'

## install R6
## install yaml
RUN apt update \
&& apt install -y --no-install-recommends r-cran-r6 \
&& Rscript --no-save --no-restore -e 'remotes::install_cran("R6")'
&& apt install -y --no-install-recommends r-cran-yaml \
&& Rscript --no-save --no-restore -e 'remotes::install_cran("yaml")'

## install rcmdcheck
## install curl
RUN apt update \
&& apt install -y --no-install-recommends r-cran-rcmdcheck \
&& Rscript --no-save --no-restore -e 'remotes::install_cran("rcmdcheck")'
&& apt install -y --no-install-recommends r-cran-curl \
&& Rscript --no-save --no-restore -e 'remotes::install_cran("curl")'

## install renv
RUN Rscript --no-save --no-restore -e 'remotes::install_cran("renv")'

## install rgdal
## install covr
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libgdal-dev \
libproj-dev \
r-cran-rgdal \
libharfbuzz-dev \
libfribidi-dev \
r-cran-covr \
&& apt-get clean \
&& Rscript --no-save --no-restore -e 'remotes::install_cran("rgdal")'
&& Rscript --no-save --no-restore -e 'remotes::install_cran("covr")'

## install lintr
RUN Rscript --no-save --no-restore -e 'remotes::install_cran("lintr")'

## install rcmdcheck
RUN apt update \
&& apt install -y --no-install-recommends r-cran-rcmdcheck \
&& Rscript --no-save --no-restore -e 'remotes::install_cran("rcmdcheck")'

## install rmarkdown
RUN apt update \
Expand All @@ -160,42 +118,75 @@ RUN apt update \
&& apt install -y --no-install-recommends r-cran-roxygen2 \
&& Rscript --no-save --no-restore -e 'remotes::install_cran("roxygen2")'

## install INLA
RUN Rscript --no-save --no-restore -e 'remotes::install_cran("INLA", type = "source")'

## install bookdown
RUN apt update \
&& apt install -y --no-install-recommends r-cran-bookdown \
&& Rscript --no-save --no-restore -e 'remotes::install_cran("bookdown")'

## install mockery
RUN apt update \
&& apt install -y --no-install-recommends r-cran-mockery \
&& Rscript --no-save --no-restore -e 'remotes::install_cran("mockery")'

## install pdftools
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libpoppler-cpp-dev \
r-cran-pdftools \
&& Rscript --no-save --no-restore -e 'remotes::install_cran("pdftools")'

## install rstudioapi
RUN apt update \
&& apt install -y --no-install-recommends r-cran-rstudioapi \
&& Rscript --no-save --no-restore -e 'remotes::install_cran("rstudioapi")'

## install sessioninfo
## install codemetar
RUN Rscript --no-save --no-restore -e 'remotes::install_cran("codemetar")'

## install testthat
RUN apt update \
&& apt install -y --no-install-recommends r-cran-sessioninfo \
&& Rscript --no-save --no-restore -e 'remotes::install_cran("sessioninfo")'
&& apt install -y --no-install-recommends r-cran-testthat \
&& Rscript --no-save --no-restore -e 'remotes::install_cran("testthat")'

## install showtext
RUN Rscript --no-save --no-restore -e 'remotes::install_cran("showtext")'
## install pkgdown
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libfontconfig1-dev \
libfreetype6-dev \
libjpeg-dev \
libpng-dev \
libtiff5-dev \
&& Rscript --no-save --no-restore -e 'remotes::install_cran("pkgdown")'

## install sysfonts
RUN Rscript --no-save --no-restore -e 'remotes::install_cran("sysfonts")'

## install testthat
RUN apt update \
&& apt install -y --no-install-recommends r-cran-testthat \
&& Rscript --no-save --no-restore -e 'remotes::install_cran("testthat")'
## install showtext
RUN Rscript --no-save --no-restore -e 'remotes::install_cran("showtext")'

## install withr
RUN apt update \
&& apt install -y --no-install-recommends r-cran-withr \
&& Rscript --no-save --no-restore -e 'remotes::install_cran("withr")'
## install hexSticker
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libmagick++-dev \
&& apt-get clean \
&& Rscript --no-save --no-restore -e 'remotes::install_cran("hexSticker")'

## install yaml
## install devtools
RUN apt update \
&& apt install -y --no-install-recommends r-cran-yaml \
&& Rscript --no-save --no-restore -e 'remotes::install_cran("yaml")'
&& apt install -y --no-install-recommends r-cran-devtools \
&& Rscript --no-save --no-restore -e 'remotes::install_cran("devtools")'

## install zen4R
RUN apt update \
&& apt install -y --no-install-recommends libsecret-1-dev \
&& Rscript --no-save --no-restore -e 'remotes::install_cran("zen4R")'

## install microbenchmark
RUN Rscript --no-save --no-restore -e 'remotes::install_cran("microbenchmark")'

## install checklist
COPY . /checklist/
RUN Rscript --no-save --no-restore -e 'remotes::install_local("checklist", upgrade = "always")'
Expand Down
11 changes: 11 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
# checklist 0.3.4

* `check_spelling()` ignores numbers.
* Ask which GitHub organisation to use when create a new project.
Default equals the organisation's default.
* GitHub Action for project allow to install package prior to checking the
project.
Use this in case `check_lintr()` returns an error about global variables in a
function and you did `require()` the package.
* Fix release GitHub Action.

# checklist 0.3.3

* New `organisation()` class to hold the requirements of the organisation.
Expand Down
5 changes: 0 additions & 5 deletions R/check_project.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@
#' @importFrom fs is_file
#' @family project
check_project <- function(x = ".", fail = !interactive(), quiet = FALSE) {
assert_that(
inherits(x, "checklist") || is_file(path(x, "checklist.yml")),
msg = "Please initialise the project first with `setup_project()`"
)

x <- read_checklist(x = x)
if (x$package) {
return(check_package(x = x, fail = fail, quiet = quiet))
Expand Down
4 changes: 2 additions & 2 deletions R/read_checklist.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ read_checklist <- function(x = ".") {
}
if (allowed$package) {
x <- checklist$new(
x = x, package = TRUE,
x = current, package = TRUE,
language = ifelse(
has_name(allowed$spelling, "default"), allowed$spelling$default, "en-GB"
)
)
} else {
x <- checklist$new(
x = x, package = FALSE,
x = current, package = FALSE,
language = ifelse(
has_name(allowed$spelling, "default"), allowed$spelling$default, "en-GB"
)
Expand Down
4 changes: 3 additions & 1 deletion R/set_tag.R
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ set_tag <- function(x = ".") {
repo = repo
)

tag_message <- paste(news[seq(start[current], end[current])], collapse = "\n")
tag_message <- paste(
news[seq(start[current] + 2, end[current])], collapse = "\n"
)
git_tag_create(
name = paste0("v", version), message = tag_message, repo = repo
)
Expand Down
15 changes: 4 additions & 11 deletions R/setup_project.R
Original file line number Diff line number Diff line change
Expand Up @@ -258,25 +258,18 @@ preferred_protocol <- function() {
config <- read_yaml(config_file)
}
if (
!has_name(config, "git") || !has_name(config$git, "protocol") ||
!has_name(config$git, "organisation")
!has_name(config, "git") || !has_name(config$git, "protocol")
) {
org <- organisation$new()
sprintf(
"What is your default GitHub organisation. Leave empty for `%s`.",
org$get_github
) |>
readline() -> config[["git"]][["organisation"]]
if (config[["git"]][["organisation"]] == "") {
config[["git"]][["organisation"]] <- org$get_github
}
c("https (easy)", "ssh (more secure)") |>
menu_first(title = "Which protocol do you prefer?") -> protocol
config[["git"]][["protocol"]] <- c("https", "ssh")[protocol]
dirname(config_file) |>
dir_create()
write_yaml(x = config, file = config_file, fileEncoding = "UTF-8")
}
org <- organisation$new()
sprintf("Which GitHub organisation. Leave empty for `%s`.", org$get_github) |>
readline() -> config[["git"]][["organisation"]]
ifelse(
config$git$protocol == "https", "https://github.com/%s/%%s.git",
"[email protected]:%s/%%s.git"
Expand Down
Loading

0 comments on commit cef05b1

Please sign in to comment.