Skip to content

Fix cli::format_error call in get_desc_config_flag - #224

Open
sims1253 wants to merge 2 commits into
r-lib:mainfrom
sims1253:fix/ry-audit-round2
Open

sims1253 wants to merge 2 commits into
r-lib:mainfrom
sims1253:fix/ry-audit-round2

Conversation

@sims1253

@sims1253 sims1253 commented Sep 9, 2026

Copy link
Copy Markdown

get_desc_config_flag() in R/utils.R reports an invalid DESCRIPTION flag with:

stop(cli::format_error(
  "The {.code {name}} entry in {.path DESCRIPTION} must be {.code TRUE}
   or {.code FALSE}.",
  "i" = "It is {.val {val}}."
))

cli::format_error() has no ..., so the named "i" argument errors with "unused argument" whenever this validation fires, and the user never sees the intended message.

The call now wraps the messages in a named vector, the pattern the sibling format_error() calls in the same file already use:

Error in `get_desc_config_flag()`:
  ! The `Config/build/never-clean` entry in 'DESCRIPTION' must be `TRUE` or `FALSE`.
  i It is "maybe".

Found during my most recent ry audit.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant