-
Notifications
You must be signed in to change notification settings - Fork 186
Missing object_usage_linter due to line break #507
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
Labels
bug
an unexpected problem or unintended behavior
Comments
A variant of this that bit me today: multiline conditionals.
|
Thanks for reporting. foo <- function() {
# warns
if (unknown_function()) NULL
# does not warn
if (unknown_function()) {
NULL
}
}
codetools::checkUsage(foo)
#> <anonymous>: no visible global function definition for 'unknown_function' (<text>:4)
#> <anonymous>: no visible global function definition for 'unknown_function' (<text>:7-9)
lintr:::parse_check_usage(foo)
#> message name
#> 1 no visible global function definition for 'unknown_function' unknown_function
#> 2 <NA> <NA>
#> path line_number
#> 1 <text> 4
#> 2 <NA> <NA> Created on 2021-02-15 by the reprex package (v1.0.0) |
AshesITR
added a commit
that referenced
this issue
Feb 15, 2021
3 tasks
AshesITR
added a commit
that referenced
this issue
Feb 18, 2021
) * Correctly parse checkUsage when a multiline warning is encountered fixes #507 * 100% coverage for object_usage_linter * improve location detection, nolint new false positive lints. * fix single-line case add tests for 100% coverage * nzchar over !="" * add comments * clean up globalVariables() and remove nolint sections Co-authored-by: Michael Chirico <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I get this in VS Code, while in my opinion, the middle call should also be detected.
The text was updated successfully, but these errors were encountered: