From ch|r|com @end|ng |rom goog|e@com  Thu Nov  4 19:50:04 2021
From: ch|r|com @end|ng |rom goog|e@com (Michael Chirico)
Date: Thu, 4 Nov 2021 11:50:04 -0700
Subject: [Rd] .onLoad, packageStartupMessage, and R CMD check
Message-ID: <CAD7Bkx9ySNzwwbnADzA3k=AA8gvW-jMdO+C_w9eHOAXR5pCeOg@mail.gmail.com>

I wrote a linter to stop users from using packageStartupMessage() in
their .onLoad() hook because of the R CMD check warning it triggers:

https://github.com/wch/r-source/blob/8b6625e39cd62424dc23399dade37f20fa8afa91/src/library/tools/R/QC.R#L5167

However, this received some pushback which I ultimately agree with,
and moreover ?.onLoad seems to agree as well:

> Loading a namespace should where possible be silent, with startup
messages given by \code{.onAttach}. These messages (**and any essential
ones from \code{.onLoad}**) should use \code{\link{packageStartupMessage}}
so they can be silenced where they would be a distraction.

**emphasis** mine. That is, if we think some message is _essential_ to
print during loadNamespace(), we are told to use
packageStartupMessage().

Should we remove this R CMD check warning?



[Rd] .onLoad, packageStartupMessage, and R CMD check
Michael Chirico