condition_call_linter {lintr} | R Documentation |
Recommend usage of call. = FALSE
in conditions
Description
This linter, with the default display_call = FALSE
, enforces the
recommendation of the tidyverse design guide regarding displaying error
calls.
Usage
condition_call_linter(display_call = FALSE)
Arguments
display_call |
Logical specifying expected behavior regarding
|
Tags
best_practices, configurable, style, tidy_design
See Also
-
linters for a complete list of linters available in lintr.
Examples
# will produce lints
lint(
text = "stop('test')",
linters = condition_call_linter()
)
lint(
text = "stop('test', call. = TRUE)",
linters = condition_call_linter()
)
lint(
text = "stop('test', call. = FALSE)",
linters = condition_call_linter(display_call = TRUE)
)
lint(
text = "stop('this is a', 'test', call. = FALSE)",
linters = condition_call_linter(display_call = TRUE)
)
# okay
lint(
text = "stop('test', call. = FALSE)",
linters = condition_call_linter()
)
lint(
text = "stop('this is a', 'test', call. = FALSE)",
linters = condition_call_linter()
)
lint(
text = "stop('test', call. = TRUE)",
linters = condition_call_linter(display_call = TRUE)
)
[Package lintr version 3.2.0 Index]