Skip to content

consecutive_assertion_linter() gives false positive when interceded by '=' assignment #2444

Closed
@MichaelChirico

Description

@MichaelChirico
lint("
stopifnot(a)
b=c
stopifnot(d)
", consecutive_assertion_linter())
# <text>:2:1: warning: [consecutive_assertion_linter] Unify consecutive calls to stopifnot().
# stopifnot(a)
# ^~~~~~~~~~~~

Almost surely this is because of the weird <expr_or_assign_or_help> node that is usually <expr>.

Metadata

Metadata

Assignees

No one assigned

    Labels

    false-positivecode that shouldn't lint, but does

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions