Closed
Description
The "missing argument" form of quote(expr =)
causes an infix_spaces_linter
error. This syntax is suggested by http://adv-r.had.co.nz/Expressions.html#names
If the expression is rewritten as quote(expr = )
, it causes a spaces_inside_linter
error.
These errors can be avoided by nolint
directive comments, but that feels excessive for recommended syntax.
# Code showing both erring syntaxes, and the directive suppressing the issue.
original <- pairlist(path = quote(expr =))
modified <- pairlist(path = quote(expr = ))
avoided <- pairlist(path = quote(expr =)) # nolint: infix_spaces_linter.
# Sample output.
R -s -e 'lintr::lint_dir(".")'
# => examples.R:1:40: style: [infix_spaces_linter] Put spaces around all infix operators.
# => original <- pairlist(path = quote(expr =))
# => ^
# => examples.R:2:41: style: [spaces_inside_linter] Do not place spaces before parentheses.
# => modified <- pairlist(path = quote(expr = ))
# => ^