Learn R Programming

box.linters (version 0.10.6)

box_func_import_count_linter: box library function import count linter

Description

Checks that function imports do not exceed the defined max.

Usage

box_func_import_count_linter(max = 8L)

Value

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

Arguments

max

Maximum function imports allowed between [ and ]. Defaults to 8.

Details

For use in rhino, see the Explanation: Rhino style guide to learn about the details.

Examples

Run this code
# will produce lints
lintr::lint(
  text = "box::use(package[one, two, three, four, five, six, seven, eight, nine])",
  linters = box_func_import_count_linter()
)

lintr::lint(
  text = "box::use(package[one, two, three, four])",
  linters = box_func_import_count_linter(3)
)

# okay
lintr::lint(
  text = "box::use(package[one, two, three, four, five])",
  linters = box_func_import_count_linter()
)

lintr::lint(
  text = "box::use(package[one, two, three])",
  linters = box_func_import_count_linter(3)
)

Run the code above in your browser using DataLab