Skip to contents

It is preferable to register routines for efficiency and safety.

Usage

routine_registration_linter()

Examples

# will produce lints
lint(
  text = '.Call("cpp_routine", PACKAGE = "mypkg")',
  linters = routine_registration_linter()
)
#> <text>:1:7: warning: [routine_registration_linter] Register your native code routines with useDynLib and R_registerRoutines().
#> .Call("cpp_routine", PACKAGE = "mypkg")
#>       ^~~~~~~~~~~~~

lint(
  text = '.Fortran("f_routine", PACKAGE = "mypkg")',
  linters = routine_registration_linter()
)
#> <text>:1:10: warning: [routine_registration_linter] Register your native code routines with useDynLib and R_registerRoutines().
#> .Fortran("f_routine", PACKAGE = "mypkg")
#>          ^~~~~~~~~~~

# okay
lint(
  text = ".Call(cpp_routine)",
  linters = routine_registration_linter()
)
#>  No lints found.

lint(
  text = ".Fortran(f_routine)",
  linters = routine_registration_linter()
)
#>  No lints found.