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

equals_na_linter finds lints within comments #545

Closed
MichaelChirico opened this issue Oct 30, 2020 · 0 comments · Fixed by #546
Closed

equals_na_linter finds lints within comments #545

MichaelChirico opened this issue Oct 30, 2020 · 0 comments · Fixed by #546

Comments

@MichaelChirico
Copy link
Collaborator

MichaelChirico commented Oct 30, 2020

expect_lint("# x == NA", NULL, equals_na_linter)
#Error: got 1 lints instead of 0
# list(filename = "/tmp/RtmpISkLn0/file28f330767e742d", line_number = 1, column_number = 5, type = "warning", message = "Use is.na rather than == NA.", line = "# x == NA", ranges = list(c(5, 9)), linter = "equals_na_linter")

In fact it doesn't even need to be in a comment:

expect_lint("' x == NA'", NULL, equals_na_linter)
#Error: got 1 lints instead of 0
# list(filename = "/tmp/RtmpISkLn0/file28f330767e742d", line_number = 1, column_number = 5, type = "warning", message = "Use is.na rather than == NA.", line = "' x == NA'", ranges = list(c(5, 9)), linter = "equals_na_linter")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant