From 04f115aad0cb53c517e0e04cce08b8e53f07b939 Mon Sep 17 00:00:00 2001 From: kapsner Date: Thu, 13 Apr 2023 17:26:48 +0200 Subject: [PATCH] chore: more informative error messages --- DESCRIPTION | 5 ++--- NEWS.md | 18 ++++++++++++++++-- R/generate_autonewsmd.R | 2 +- R/init_autonewsmd.R | 7 ++++--- R/write_autonewsmd.R | 6 +++--- data-raw/devstuffs.R | 2 +- 6 files changed, 27 insertions(+), 13 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 9412366..69dce20 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: autonewsmd Title: Auto-Generate Changelog using Conventional Commits -Version: 0.0.5 +Version: 0.0.6 Authors@R: person("Lorenz A.", "Kapsner", , "lorenz.kapsner@gmail.com", role = c("cre", "aut", "cph"), comment = c(ORCID = "0000-0003-1866-860X")) @@ -25,6 +25,5 @@ Suggests: testthat (>= 3.0.1) VignetteBuilder: knitr -Date/Publication: 2023-01-21 08:39:41 UTC +Date/Publication: 2023-04-13 15:26:10 UTC Encoding: UTF-8 -RoxygenNote: 7.2.3 diff --git a/NEWS.md b/NEWS.md index ba610e0..920d1aa 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,10 +1,24 @@ # autonewsmd NEWS +## Unreleased (2023-01-21) -## Unreleased (2023-01-20) +#### Other changes + +- added pkg to readme + ([c84e5ec](https://github.com/kapsner/autonewsmd/tree/c84e5ecec14804c9775ef512822dd4aeb6b977d6)) + +## v0.0.5 (2023-01-21) #### Other changes +- merged yihuis patch + ([851b893](https://github.com/kapsner/autonewsmd/tree/851b893cd39bd7fee18249bcf5a1a7b4e5f4e803)) +- updated readme, news.md + ([647a8c7](https://github.com/kapsner/autonewsmd/tree/647a8c7e26e7d95f57a204683c7767541980e380)) +- fixed cran-checks badge + ([f24b8e5](https://github.com/kapsner/autonewsmd/tree/f24b8e55fa4e376b7d2bca039b66d831310d51d4)) +- added authors-block to readme + ([a9211ea](https://github.com/kapsner/autonewsmd/tree/a9211ea4994e5d53aff9989f43afbb33a094a094)) - added mlsurvlrnrs pkg to used by section ([3d5a012](https://github.com/kapsner/autonewsmd/tree/3d5a012643fd6bedb54e23ffd870d6447cadbb63)) - merge pull request \#5 from kapsner/development @@ -13,7 +27,7 @@ ([5decf24](https://github.com/kapsner/autonewsmd/tree/5decf248ec4b12bcdc54baeedf631075657fad5a)) Full set of changes: -[`v0.0.4...88ba8e1`](https://github.com/kapsner/autonewsmd/compare/v0.0.4...88ba8e1) +[`v0.0.4...v0.0.5`](https://github.com/kapsner/autonewsmd/compare/v0.0.4...v0.0.5) ## v0.0.4 (2022-10-31) diff --git a/R/generate_autonewsmd.R b/R/generate_autonewsmd.R index 9e2b551..d19b711 100644 --- a/R/generate_autonewsmd.R +++ b/R/generate_autonewsmd.R @@ -112,7 +112,7 @@ generate_autonewsmd <- function(self, private) { if (i == 1) { set_tag <- "Unreleased" } - stopifnot(!is.null(set_tag)) + stopifnot("`set_tag` must not be empty at this point" = !is.null(set_tag)) repo_df[i, ("tag") := set_tag] } } diff --git a/R/init_autonewsmd.R b/R/init_autonewsmd.R index 95938da..dfe2d1e 100644 --- a/R/init_autonewsmd.R +++ b/R/init_autonewsmd.R @@ -16,13 +16,14 @@ init_autonewsmd <- function(self, private, repo_name, repo_path, repo_remotes) { stopifnot( - is.character(repo_name), - ifelse( + "`repo_name` must be a character string" = is.character(repo_name), + "`repo_remotes` must be a character string" = ifelse( test = is.null(repo_remotes), yes = TRUE, no = is.character(repo_remotes) ), - ifelse( + "`repo_path` must be a character string and \ + the directory must exist on the file system" = ifelse( test = is.null(repo_path), yes = TRUE, no = is.character(repo_path) && dir.exists(repo_path) diff --git a/R/write_autonewsmd.R b/R/write_autonewsmd.R index 0b6588d..2256b73 100644 --- a/R/write_autonewsmd.R +++ b/R/write_autonewsmd.R @@ -17,9 +17,9 @@ write_autonewsmd <- function(self, private, force, con) { stopifnot( - !is.null(self$repo_list), - !is.null(private$repo_url), - is.logical(force) + "`repo_list` is missing or `NULL`" = !is.null(self$repo_list), + "`repo_url` is missing or `NULL`" = !is.null(private$repo_url), + "`force` must be a boolean value" = is.logical(force) ) if (isFALSE(force)) { diff --git a/data-raw/devstuffs.R b/data-raw/devstuffs.R index df05291..a098cd8 100644 --- a/data-raw/devstuffs.R +++ b/data-raw/devstuffs.R @@ -19,7 +19,7 @@ my_desc$set_authors(c( # Remove some author fields my_desc$del("Maintainer") # Set the version -my_desc$set_version("0.0.5") +my_desc$set_version("0.0.6") # The title of your package my_desc$set(Title = "Auto-Generate Changelog using Conventional Commits") # The description of your package