Skip to contents

Checks that packages and modules are imported in separate box::use() statements. See the Explanation: Rhino style guide to learn about the details.

Usage

box_separate_calls_linter()

Value

A custom linter function for use with r-lib/lintr

Examples

# will produce lints
lintr::lint(
  text = "box::use(package, path/to/file)",
  linters = box_separate_calls_linter()
)
#> ::warning file=<text>,line=1,col=1::file=<text>,line=1,col=1,[box_separate_calls_linter] Separate packages and modules in their respective box::use() calls.

lintr::lint(
  text = "box::use(path/to/file, package)",
  linters = box_separate_calls_linter()
)
#> ::warning file=<text>,line=1,col=1::file=<text>,line=1,col=1,[box_separate_calls_linter] Separate packages and modules in their respective box::use() calls.

# okay
lintr::lint(
  text = "box::use(package1, package2)
    box::use(path/to/file1, path/to/file2)",
  linters = box_separate_calls_linter()
)