Skip to content

Commit

Permalink
chore: more informative error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
kapsner committed Apr 13, 2023
1 parent c84e5ec commit 04f115a
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 13 deletions.
5 changes: 2 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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", , "[email protected]", role = c("cre", "aut", "cph"),
comment = c(ORCID = "0000-0003-1866-860X"))
Expand All @@ -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
18 changes: 16 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion R/generate_autonewsmd.R
Original file line number Diff line number Diff line change
Expand Up @@ -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]
}
}
Expand Down
7 changes: 4 additions & 3 deletions R/init_autonewsmd.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions R/write_autonewsmd.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
2 changes: 1 addition & 1 deletion data-raw/devstuffs.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 04f115a

Please sign in to comment.