Open etiennebacher opened 1 week ago
messages should be produced by .onAttach, not .onLoad
Then I think messages from .onLoad
should say something like:
Don't use cat() in .onLoad(). Use
packageStartupMessage()
in.onAttach()
instead.
and messages from .onAttach()
could say:
Don't use cat() in .onAttach(). Use
packageStartupMessage()
instead.
I suggest using a more active lint message for .onAttach
:
Use
packageStartupMessage()
instead ofcat()
in .onAttach().
Some
lintr
messages show the potential replacement for a linter, e.g. inany_duplicated_linter
:However, some messages are not very helpful because they don’t recommend any replacement. For example,
package_hooks_linter
saysDon't use cat() in .onAttach().
:Is it possible to suggest the replacement for this linter? My reflex was to use
message()
instead but this is also flagged. Same withpackageStartupMessage()
(only flagged in.onLoad()
, not in.onAttach()
) so I don’t know what should be used here.