Spaces before parentheses linter
Source:R/spaces_left_parentheses_linter.R
spaces_left_parentheses_linter.Rd
Check that all left parentheses have a space before them unless they are in a function call.
See also
linters for a complete list of linters available in lintr.
Examples
# will produce lints
lint(
text = "if(TRUE) x else y",
linters = spaces_left_parentheses_linter()
)
#> <text>:1:3: style: [spaces_left_parentheses_linter] Place a space before left parenthesis, except in a function call.
#> if(TRUE) x else y
#> ^
# okay
lint(
text = "if (TRUE) x else y",
linters = spaces_left_parentheses_linter()
)
#> ℹ No lints found.