Skip to content

quote(expr =) should be allowed #1889

Closed
@aronatkins

Description

@aronatkins

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 = ))
# =>                                         ^

Metadata

Metadata

Assignees

No one assigned

    Labels

    false-positivecode that shouldn't lint, but does

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions