Skip to content

Review and update the message_chk() documentation of the sprintf-like types #314

Description

@joethorley

The set of sprintf-like types accepted by message_chk() has grown (%es and the %% escape in #293, alongside %n, %s, %r, %y and %ies) but the documentation has not been reviewed as a whole.

Points to review:

  • The %y entry reads 'y' if n == 1 otherwise 'ie', which is only usable when followed by %s.
    Its relationship to %ies is not explained (see Deprecate %y in favour of %ies in message_chk() #313).
  • The single left-to-right pass is described, but there is no worked example showing why %% escapes a literal % and why %es is not consumed by %s.
  • A lone % that does not start a recognized type is left as is; this is stated but not shown in the examples.
  • The examples use director%y%s throughout and do not demonstrate %ies at all.
  • Only a single n applies to the whole message (message_chk() supports only one count per message #311); the documentation does not say so.
  • The types are documented only in ?message_chk; err(), wrn() and msg() inherit the n parameter but a reader landing on ?err has no visible list of the types.
    Consider whether the section should be shared or cross-referenced.
  • Nothing in the README or the vignettes covers message construction; consider whether it belongs in vignettes/chk.Rmd.

Outcome: a reviewed and consistent @section sprintf-like types: block with examples that exercise every type, and cross-references from ?err.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions