# will produce lints
lint(
text = ".onLoad <- function(lib, ...) { }",
linters = package_hooks_linter()
)
lint(
text = ".onAttach <- function(lib, pkg) { require(foo) }",
linters = package_hooks_linter()
)
lint(
text = ".onDetach <- function(pkg) { }",
linters = package_hooks_linter()
)
# okay
lint(
text = ".onLoad <- function(lib, pkg) { }",
linters = package_hooks_linter()
)
lint(
text = '.onAttach <- function(lib, pkg) { loadNamespace("foo") }',
linters = package_hooks_linter()
)
lint(
text = ".onDetach <- function(lib) { }",
linters = package_hooks_linter()
)
Run the code above in your browser using DataLab