Skip to content

Clean-up: use expect_no_lint() where appropriate #2737

Open
@MichaelChirico

Description

@MichaelChirico

expect_no_lint() is a nice alternative to expect_lint(., NULL, .). We should use it where possible.

This will be a relatively large lift: there are about 1,500 call sites to expect_lint() with NULL:

linter = make_linter_from_xpath("//SYMBOL_FUNCTION_CALL[text() = 'expect_lint']/parent::expr/following-sibling::expr/NULL_CONST", "xxx")
lints = lint_package(linters = linter())
length(lints)
# [1] 1536

We could also introduce a linter for this, but I reckon it's too localized to warrant a new export. We can add it as a custom local linter to our suite I reckon.

Metadata

Metadata

Assignees

No one assigned

    Labels

    internalsIssues related to inner workings of lintr, i.e., not user-visible

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions