Skip to content

Different behaviour of undesirable linters with empty character vectors #1867

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

Closed
IndrajeetPatil opened this issue Dec 20, 2022 · 1 comment · Fixed by #1870
Closed

Different behaviour of undesirable linters with empty character vectors #1867

IndrajeetPatil opened this issue Dec 20, 2022 · 1 comment · Fixed by #1870
Labels
bug an unexpected problem or unintended behavior consistency 🍎 🍏

Comments

@IndrajeetPatil
Copy link
Collaborator

I'd have expected both of these arguments to have similar behaviour. Is this expected?

library(lintr)

invisible(undesirable_function_linter(fun = character(0L)))

undesirable_operator_linter(op = character(0L))
#> Error in undesirable_operator_linter(op = character(0L)): 'op' should be a named character vector; use missing elements to indicate default messages.

Created on 2022-12-20 with reprex v2.0.2

@AshesITR AshesITR added the bug an unexpected problem or unintended behavior label Dec 20, 2022
@AshesITR
Copy link
Collaborator

Agree. Both of them should error because there should be no need to create a no-op linter.

AshesITR pushed a commit that referenced this issue Dec 23, 2022
* Error on empty character vector args in undesirable linters

Closes #1867

* Update NEWS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior consistency 🍎 🍏
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants