We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
unreachable_code_linter
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
As soon as there is a comment after the return or stop, it is correctly not linted, but neither are the following lines.
return
stop
Will produce lints:
foo <- function() { return(3) 5 + 2 }
False negative:
foo <- function() { return(3) # A comment 5 + 2 }
The same applies to something that @MichaelChirico has already marked as a todo in the code, but I haven't found an issue about it:
lintr/tests/testthat/test-unreachable_code_linter.R
Line 181 in c8f0074
foo <- function() { return(3); x + 1 5 + 2 }
The text was updated successfully, but these errors were encountered:
I think I've already found a solution and will probably post the PR when I've finished #2123
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
As soon as there is a comment after the
return
orstop
, it is correctly not linted, but neither are the following lines.Will produce lints:
False negative:
The same applies to something that @MichaelChirico has already marked as a todo in the code, but I haven't found an issue about it:
lintr/tests/testthat/test-unreachable_code_linter.R
Line 181 in c8f0074
However, not only will the following expression in the same line not be marked, but also those in subsequent lines will not be marked.
False negative:
The text was updated successfully, but these errors were encountered: