Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
MichaelChirico opened this issue Feb 12, 2025 · 1 comment
Open

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

MichaelChirico opened this issue Feb 12, 2025 · 1 comment
Labels
internals Issues related to inner workings of lintr, i.e., not user-visible

Comments

@MichaelChirico
Copy link
Collaborator

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.

@MichaelChirico MichaelChirico added the internals Issues related to inner workings of lintr, i.e., not user-visible label Feb 12, 2025
@AshesITR
Copy link
Collaborator

Maybe we can do a staged effort for this again by applying on the lint-changed-files workflow only until it's resolved?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internals Issues related to inner workings of lintr, i.e., not user-visible
Projects
None yet
Development

No branches or pull requests

2 participants