Skip to content

FR: add argument to disable linting of ( for auto-printing in implicit_assignment_linter #2916

@TimTaylor

Description

@TimTaylor

Would it be possible to gain a parameter in the implicit_assignment_linter to allow for implicit printing? At present, I see no way to disable this, e.g

lintr::lint(
    text = "(a <- 1)", 
    linters = lintr::implicit_assignment_linter()
)
#> <text>:1:2: warning: [implicit_assignment_linter] Call print() explicitly instead of relying on implicit printing behavior via '('.
#> (a <- 1)
#>  ^~~~~~

lintr::lint(
    text = "(a <- 1)", 
    linters = lintr::implicit_assignment_linter(except = "`(`")
)
#> <text>:1:2: warning: [implicit_assignment_linter] Call print() explicitly instead of relying on implicit printing behavior via '('.
#> (a <- 1)
#>  ^~~~~~

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions