-
Notifications
You must be signed in to change notification settings - Fork 186
/
Copy pathpackage_hooks_linter.Rd
29 lines (29 loc) · 1.67 KB
/
package_hooks_linter.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/package_hooks_linter.R
\name{package_hooks_linter}
\alias{package_hooks_linter}
\title{Package hooks linter}
\usage{
package_hooks_linter()
}
\description{
Check various common "gotchas" in \code{\link[=.onLoad]{.onLoad()}}, \code{\link[=.onAttach]{.onAttach()}}, \code{\link[=.Last.lib]{.Last.lib()}}, and \code{\link[=.onDetach]{.onDetach()}}
namespace hooks that will cause \verb{R CMD check} issues. See Writing R Extensions for details.
}
\details{
\enumerate{
\item \code{.onLoad()} shouldn't call \code{\link[=cat]{cat()}}, \code{\link[=message]{message()}}, \code{\link[=print]{print()}}, \code{\link[=writeLines]{writeLines()}}, \code{\link[=packageStartupMessage]{packageStartupMessage()}},
\code{\link[=require]{require()}}, \code{\link[=library]{library()}}, or \code{\link[=installed.packages]{installed.packages()}}.
\item \code{.onAttach()} shouldn't call \code{cat()}, \code{message()}, \code{print()}, \code{writeLines()}, \code{\link[=library.dynam]{library.dynam()}},
\code{require()}, \code{library()}, or \code{installed.packages()}.
\item \code{.Last.lib()} and \code{.onDetach()} shouldn't call \code{\link[=library.dynam.unload]{library.dynam.unload()}}.
\item \code{.onLoad()} and \code{.onAttach()} should take two arguments, with names matching \verb{^lib} and \verb{^pkg};
\code{.Last.lib()} and \code{.onDetach()} should take one argument with name matching \verb{^lib}.
}
}
\seealso{
\link{linters} for a complete list of linters available in lintr.
}
\section{Tags}{
\link[=correctness_linters]{correctness}, \link[=package_development_linters]{package_development}, \link[=style_linters]{style}
}