You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
usethis::use_lifecycle() allows to use \lifecycle{...} in function docs. If lifecycle is not referenced anywhere else in the package, R CMD check will raise a NOTE.
# develop a packageusethis::use_lifecycle()
# add \lifecycle{...} to some function docsgoodpractice::goodpractice() # raises R CMD check NOTE on unused library `lifecycle`:NcheckingdependenciesinR code (401ms)
NamespaceinImportsfieldnotimportedfrom: ‘lifecycle’
AlldeclaredImportsshouldbeused.
@lionel- suggested to include a NOOP anywhere in the code:
if (FALSE) lifecycle::deprecate_soft()
This expression can live in a stand-alone file like R/utils-lifecycle.R.
To preserve test coverage, depending on the coverage tool used, this file should be excluded. For codecov.io, this could look like this. Thinking out loud: it is fine to exclude from tests, as the expression will never run.
As a feature request to usethis::use_lifecycle(), could I suggest to
generate a file containing a NOOP like if (FALSE) lifecycle::deprecate_soft(), and
exclude that file from whichever test coverage tool is used (or at least message to do so).
The text was updated successfully, but these errors were encountered:
Problem
First reported at r-lib/lifecycle#22
usethis::use_lifecycle()
allows to use\lifecycle{...}
in function docs. Iflifecycle
is not referenced anywhere else in the package, R CMD check will raise a NOTE.@lionel- suggested to include a NOOP anywhere in the code:
This expression can live in a stand-alone file like
R/utils-lifecycle.R
.To preserve test coverage, depending on the coverage tool used, this file should be excluded. For
codecov.io
, this could look like this. Thinking out loud: it is fine to exclude from tests, as the expression will never run.As a feature request to
usethis::use_lifecycle()
, could I suggest toif (FALSE) lifecycle::deprecate_soft()
, andThe text was updated successfully, but these errors were encountered: