View source: R/function_left_parentheses_linter.R
function_left_parentheses_linter | R Documentation |
Check that all left parentheses in a function call do not have spaces before them
(e.g. mean (1:3)
). Although this is syntactically valid, it makes the code
difficult to read.
function_left_parentheses_linter()
Exceptions are made for control flow functions (if
, for
, etc.).
default, readability, style
linters for a complete list of linters available in lintr.
spaces_left_parentheses_linter()
# will produce lints
lint(
text = "mean (x)",
linters = function_left_parentheses_linter()
)
lint(
text = "stats::sd(c (x, y, z))",
linters = function_left_parentheses_linter()
)
# okay
lint(
text = "mean(x)",
linters = function_left_parentheses_linter()
)
lint(
text = "stats::sd(c(x, y, z))",
linters = function_left_parentheses_linter()
)
lint(
text = "foo <- function(x) (x + 1)",
linters = function_left_parentheses_linter()
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.