From 6090ae7101aa1b33eb445f7fe970087c70019158 Mon Sep 17 00:00:00 2001 From: Sam El-Kamand Date: Mon, 9 Feb 2026 15:41:24 +1100 Subject: [PATCH 1/5] docs: deduped badges in readme resolves issue #141 --- README.Rmd | 1 - README.md | 6 +----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/README.Rmd b/README.Rmd index 168ef5c..356d578 100644 --- a/README.Rmd +++ b/README.Rmd @@ -23,7 +23,6 @@ knitr::opts_chunk$set( [![Closed issues](https://img.shields.io/github/issues-closed/selkamand/assertions.svg)](https://github.com/selkamand/assertions/issues?q=is%3Aissue+is%3Aclosed) [![](http://cranlogs.r-pkg.org/badges/last-month/assertions)](https://cran.r-project.org/package=assertions) [![](http://cranlogs.r-pkg.org/badges/grand-total/assertions)](https://cran.r-project.org/package=assertions) -[![Codecov test coverage](https://codecov.io/gh/selkamand/assertions/graph/badge.svg)](https://app.codecov.io/gh/selkamand/assertions) diff --git a/README.md b/README.md index 8f9408d..8e50cea 100644 --- a/README.md +++ b/README.md @@ -7,8 +7,6 @@ [![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental) -[![Codecov test -coverage](https://codecov.io/gh/selkamand/assertions/branch/main/graph/badge.svg)](https://app.codecov.io/gh/selkamand/assertions?branch=main) [![R-CMD-check](https://github.com/selkamand/assertions/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/selkamand/assertions/actions/workflows/R-CMD-check.yaml) [![](https://img.shields.io/github/languages/code-size/selkamand/assertions.svg)](https://github.com/selkamand/assertions) [![](https://img.shields.io/github/last-commit/selkamand/assertions.svg)](https://github.com/selkamand/assertions/commits/main) @@ -16,9 +14,7 @@ coverage](https://codecov.io/gh/selkamand/assertions/branch/main/graph/badge.svg issues](https://img.shields.io/github/issues-closed/selkamand/assertions.svg)](https://github.com/selkamand/assertions/issues?q=is%3Aissue+is%3Aclosed) [![](http://cranlogs.r-pkg.org/badges/last-month/assertions)](https://cran.r-project.org/package=assertions) [![](http://cranlogs.r-pkg.org/badges/grand-total/assertions)](https://cran.r-project.org/package=assertions) -[![Codecov test -coverage](https://codecov.io/gh/selkamand/assertions/graph/badge.svg)](https://app.codecov.io/gh/selkamand/assertions) -[![R-CMD-check](https://github.com/selkamand/assertions/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/selkamand/assertions/actions/workflows/R-CMD-check.yaml) + Simple assertions with sensible defaults and customisable error From 40ba792f199a8ad1943b1ad0bfce7d2e70e6d645 Mon Sep 17 00:00:00 2001 From: Sam El-Kamand Date: Mon, 9 Feb 2026 15:45:51 +1100 Subject: [PATCH 2/5] docs: reworded dev install instructions --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8e50cea..3d17d98 100644 --- a/README.md +++ b/README.md @@ -45,8 +45,8 @@ install.packages("assertions") ### Development version -To get a bug fix or to use a feature from the development version, you -can install the development version of assertions from GitHub. +You can install the development version of assertions from GitHub by +running: ``` r # install.packages('remotes') From cd85f066c3b558f885f7ba06a73421a8185a3ccd Mon Sep 17 00:00:00 2001 From: Sam El-Kamand Date: Mon, 9 Feb 2026 15:46:13 +1100 Subject: [PATCH 3/5] docs: reworded dev install instructions --- README.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.Rmd b/README.Rmd index 356d578..df1921b 100644 --- a/README.Rmd +++ b/README.Rmd @@ -51,7 +51,7 @@ install.packages("assertions") ### Development version -To get a bug fix or to use a feature from the development version, you can install the development version of assertions from GitHub. +You can install the development version of assertions from GitHub by running: ``` r # install.packages('remotes') From 9276fd88c6c0f1cafdd31789094f18955cdce292 Mon Sep 17 00:00:00 2001 From: Sam El-Kamand Date: Mon, 9 Feb 2026 15:48:22 +1100 Subject: [PATCH 4/5] docs: improved readme install code resolved #146 --- README.Rmd | 6 ++++-- README.md | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/README.Rmd b/README.Rmd index df1921b..ef2010e 100644 --- a/README.Rmd +++ b/README.Rmd @@ -54,8 +54,10 @@ install.packages("assertions") You can install the development version of assertions from GitHub by running: ``` r -# install.packages('remotes') -remotes::install_github('selkamand/assertions') +if (!require("remotes", quietly = TRUE)) + install.packages("remotes") + +remotes::install_github("selkamand/assertions") ``` ## Quick Start diff --git a/README.md b/README.md index 3d17d98..6a83880 100644 --- a/README.md +++ b/README.md @@ -49,8 +49,10 @@ You can install the development version of assertions from GitHub by running: ``` r -# install.packages('remotes') -remotes::install_github('selkamand/assertions') +if (!require("remotes", quietly = TRUE)) + install.packages("remotes") + +remotes::install_github("selkamand/assertions") ``` ## Quick Start From ef40c0e117825e26cbe8c39c80d57506d696f2e2 Mon Sep 17 00:00:00 2001 From: Sam El-Kamand Date: Mon, 9 Feb 2026 15:51:50 +1100 Subject: [PATCH 5/5] fix: assert_subset err msg grammar fix resolves issue #59 --- R/assert_set.R | 2 +- tests/testthat/_snaps/assert_set.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/R/assert_set.R b/R/assert_set.R index 57f751b..528e01b 100644 --- a/R/assert_set.R +++ b/R/assert_set.R @@ -16,7 +16,7 @@ assert_subset <- assert_create( func = is_subset, default_error_msg = c( - x = "'{.strong {arg_name}}' {cli::qty(length(setopts_exlusive_to_first(arg_value, y)))} contain{?s} {?an/} invalid value{?s}: {.strong {setopts_exlusive_to_first(arg_value, y)}}. Valid values include: {unique(y)}" + x = "'{.strong {arg_name}}' {cli::qty(length(setopts_exlusive_to_first(arg_value, y)))} contains {?an/} invalid value{?s}: {.strong {setopts_exlusive_to_first(arg_value, y)}}. Valid values include: {unique(y)}" ) ) diff --git a/tests/testthat/_snaps/assert_set.md b/tests/testthat/_snaps/assert_set.md index 5451e07..a30615d 100644 --- a/tests/testthat/_snaps/assert_set.md +++ b/tests/testthat/_snaps/assert_set.md @@ -28,7 +28,7 @@ assert_subset("def", "abc") Condition Error: - x '"def"' contain an invalid value: def. Valid values include: abc + x '"def"' contains an invalid value: def. Valid values include: abc --- @@ -36,7 +36,7 @@ assert_subset(c("A"), c(1, 2, 3)) Condition Error: - x 'c("A")' contain an invalid value: A. Valid values include: 1, 2, and 3 + x 'c("A")' contains an invalid value: A. Valid values include: 1, 2, and 3 # assert_one_of() works [plain]