
box
library universal import linter
Source: R/box_universal_import_linter.R
box_universal_import_linter.Rd
Checks that all function imports are explicit. package[...]
is not used.
Details
For use in rhino
, see the
Explanation: Rhino style guide
to learn about the details.
Examples
# will produce lints
lintr::lint(
text = "box::use(base[...])",
linters = box_universal_import_linter()
)
#> <text>:1:15: style: [box_universal_import_linter] Explicitly declare imports rather than universally import with `...`.
#> box::use(base[...])
#> ^~~
lintr::lint(
text = "box::use(path/to/file[...])",
linters = box_universal_import_linter()
)
#> <text>:1:23: style: [box_universal_import_linter] Explicitly declare imports rather than universally import with `...`.
#> box::use(path/to/file[...])
#> ^~~
# okay
lintr::lint(
text = "box::use(base[print])",
linters = box_universal_import_linter()
)
#> ℹ No lints found.
lintr::lint(
text = "box::use(path/to/file[do_something])",
linters = box_universal_import_linter()
)
#> ℹ No lints found.