View source: R/box_alphabetical_calls_linter.R
box_alphabetical_calls_linter | R Documentation |
box
library alphabetical module and function imports linterChecks that module and function imports are sorted alphabetically. Aliases are ignored. The sort check is on package/module names and attached function names.
box_alphabetical_calls_linter()
For use in rhino
, see the
Explanation: Rhino style guide
to learn about the details.
A custom linter function for use with r-lib/lintr
.
# will produce lints
lintr::lint(
text = "box::use(packageB, packageA)",
linters = box_alphabetical_calls_linter()
)
lintr::lint(
text = "box::use(package[functionB, functionA])",
linters = box_alphabetical_calls_linter()
)
lintr::lint(
text = "box::use(path/to/B, path/to/A)",
linters = box_alphabetical_calls_linter()
)
lintr::lint(
text = "box::use(path/to/A[functionB, functionA])",
linters = box_alphabetical_calls_linter()
)
lintr::lint(
text = "box::use(path/to/A[alias = functionB, functionA])",
linters = box_alphabetical_calls_linter()
)
# okay
lintr::lint(
text = "box::use(packageA, packageB)",
linters = box_alphabetical_calls_linter()
)
lintr::lint(
text = "box::use(package[functionA, functionB])",
linters = box_alphabetical_calls_linter()
)
lintr::lint(
text = "box::use(path/to/A, path/to/B)",
linters = box_alphabetical_calls_linter()
)
lintr::lint(
text = "box::use(path/to/A[functionA, functionB])",
linters = box_alphabetical_calls_linter()
)
lintr::lint(
text = "box::use(path/to/A[functionA, alias = functionB])",
linters = box_alphabetical_calls_linter()
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.